Pine-Marjan, Megan, Roslyn#56
Open
roslynm wants to merge 4 commits intoAda-C16:mainfrom
Open
Conversation
jbieniosek
reviewed
Jan 6, 2022
jbieniosek
left a comment
There was a problem hiding this comment.
Great work on this project Marjan, Megan and Roslyn! This project is green.
| // You will need to create a method to change the square | ||
| // When it is clicked on. | ||
| // Then pass it into the squares as a callback | ||
| const updateSquares = (id) => { |
There was a problem hiding this comment.
There is a small logical bug here. There is no check here to see if there is a winner, so it is possible to continue to play. This can result in unexpected behavior. For example, if the board looks like this:
| | | |
| |o|o|
|x|x|x|
the game will display 'Winner is x'. However, 'o' can still move, so if 'o' clicks in the middle left square:
| | | |
|o|o|o|
|x|x|x|
the game will display "Winner is ". This continues until the entire board is filled, at which point the game will display "Winner is Tie".
Comment on lines
+99
to
+103
| for (let combo of winning){ | ||
| if (isSuperset(xSet,combo)){ | ||
| myX.push(combo); | ||
| } | ||
| } |
Comment on lines
+130
to
+137
| const isSuperset = (set, subset) => { | ||
| for (let elem of subset) { | ||
| if (!set.has(elem)) { | ||
| return false; | ||
| } | ||
| } | ||
| return true; | ||
| }; |
| // }else if (square.value==='o'){ | ||
| // classVal='chris'; | ||
| // } | ||
| oneD.push(<Square key={square.id} id={square.id} value={square.value} onClickCallback={onClickCallback} />); |
Comment on lines
+14
to
+22
| .jasmine { | ||
| background-image: url("https://ca.slack-edge.com/T024N8K3W8N-U029WFRD8HW-807f2572ed86-512"); | ||
| Background-size: 200px 200px; | ||
| } | ||
|
|
||
| .chris { | ||
| background-image: url("https://ca.slack-edge.com/T024N8K3W8N-U0283SDM62H-f8f25fdaa3da-512"); | ||
| Background-size: 200px 200px; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.