Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ktiktok96
Copy link

…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.

ktiktok96 added 2 commits July 5, 2021 16:31
…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
Copy link

@CheezItMan CheezItMan left a 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.

Comment on lines +52 to +53
const coordinates = cellMap[event.target.id]
if(squares[coordinates.y][coordinates.x].value!==''||winner!==''){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting solution!

Comment on lines +74 to +75
for(let x= 1; x<3; x++){
if(squares[y][x].value!==player){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

Suggested change
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>}

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 = () => {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants