Skip to content

Tic Tac Toe#2

Open
kedevlin wants to merge 12 commits intoAda-C4:ked/masterfrom
kedevlin:ked/master
Open

Tic Tac Toe#2
kedevlin wants to merge 12 commits intoAda-C4:ked/masterfrom
kedevlin:ked/master

Conversation

@kedevlin
Copy link
Copy Markdown

Completed primary requirements


TicTacToe.prototype = {

function Player(number, name, marker) {
Copy link
Copy Markdown

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.

@kariabancroft kariabancroft self-assigned this Feb 9, 2016
};

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)) {
Copy link
Copy Markdown

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.

@kariabancroft
Copy link
Copy Markdown

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!

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