Skip to content

Commit

Permalink
Bug Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaw145 committed Mar 2, 2024
1 parent 3859362 commit b4752c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions JS/SinglePlayerscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ boxes.forEach((box) =>{
box.innerText = "O";
box.disabled = true;

RandomBox();
if(count < 9 && !checkwinner()){
RandomBox();
}

//Checks the draw condition
let iswinner = checkwinner();
if(count === 9 && !iswinner){
checkwinner();
if(count === 9 && !checkwinner()){
drawSound.play();
draw.classList.remove("hide");
}
Expand Down Expand Up @@ -143,5 +145,4 @@ const backbtn = () =>{
//When "New Game"/"Reset Game" btn clicked then reset the game
newbtn.addEventListener("click", resetGame);
resetbtn.addEventListener("click", resetGame);
backBtn.addEventListener("click", backbtn);

backBtn.addEventListener("click", backbtn);
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Tic Tac Toe Game
A Tic Tac Toe Game (Full Responsive) that can be played by two players build using HTML,CSS & Javascript.
A Tic Tac Toe Game (Full Responsive) that can be played by One Player or two players build using HTML,CSS & Javascript.

## About
This is my very first mini project in javascript built from scratch using HTML, CSS, and JavaScript!. From understanding the basics of JavaScript syntax to applying it in a practical project, every step has been a valuable learning experience.
Expand Down

0 comments on commit b4752c3

Please sign in to comment.