Faulkner_Completed tic-tac-toe deliverable #273
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.
I've fixed all of the issues I was having, but for issue (a) below, I do not understand what caused it to arise in the first place:
(a) Background color of squares was not rendering at all - Tom and I figured out that the background-color property was being overridden by 'element,' some kind of default css declaration not actually in my code. This fix was to include '!important' on line 40 of the css file. Still perplexing as to why this happened in tic-tac-toe but not in my connect4 game. And I'm still perplexed as to what the element thing is and how to use/manipulate it.
(b) The winning logic was not working so wins were not triggering the completion of the game. Issue turned out to be threefold:
Deriving colIdx and rowIdx. I selected the numbers from the div ids, and so js was interpreting them as strings and concatenating them as opposed to summing their numbers. Fixed by including a parseFloat on lines 77 & 78 where they are first created.
HTML file actually had the div id labels in the wrong order
countAdjacentDown & countAdjacentUp lines (99 & 100 in script.js) in my checkVerticalWin were doing too much. They included the logic of returning null or the player when the count = 2, but all they needed to do return the count.