-
Notifications
You must be signed in to change notification settings - Fork 21
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
Tic Tac Toe #2
base: ked/master
Are you sure you want to change the base?
Tic Tac Toe #2
Conversation
} | ||
|
||
TicTacToe.prototype = { | ||
|
||
function Player(number, name, marker) { |
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.
I think that this function can be outside of the TicTacToe prototype since it represents a different type of object.
}; | ||
|
||
TicTacToe.prototype.checkWinningBoard = function() { | ||
if ((this.board[0][0] === this.current_player.number) && (this.board[0][1] === this.current_player.number) && (this.board[0][2] === this.current_player.number)) { |
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.
I wonder if you could put all of these row/col values in an array and iterate over it to slightly more dynamically create this winning sequence instead of using this many conditionals.
Nice job on this! I think your functions are nicely separated out. I think you do have an opportunity to DRY up your long conditional statement, but I think overall it is nice and readable! |
Completed primary requirements