-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finished waves 1-3: rendered Board and Squares, added Click Funtional… #69
base: master
Are you sure you want to change the base?
Conversation
…ity, Chcked For winner.Also finished enhancements and allowed reset functionality, resets the game's state and clears all the game squares. Next, I plan to work on deploying on the web
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Karla, this looks good. You're not detecting ties, but otherwise this is great work. You hit the learning goals here. Well done.
const coordinates = cellMap[event.target.id] | ||
if(squares[coordinates.y][coordinates.x].value!==''||winner!==''){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting solution!
for(let x= 1; x<3; x++){ | ||
if(squares[y][x].value!==player){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
for(let x= 1; x<3; x++){ | |
if(squares[y][x].value!==player){ | |
for(let x= 1; x<3; x++){ | |
if(squares[y][x].value!==player){ |
} | ||
|
||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<h1>React Tic Tac Toe</h1> | ||
<h2>The winner is ... -- Fill in for wave 3 </h2> | ||
<button>Reset Game</button> | ||
{winner!==''&&<h2> Winner is {winner} </h2>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tricky JS syntax
|
||
|
||
|
||
const checkForWinner = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that this function doesn't determine ties.
…ity, Checked For winner.Also finished enhancements and allowed reset functionality, resets the game's state and clears all the game squares. Next, I plan to work on deploying on the web.