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

Tic Tac Toe #2

Open
wants to merge 12 commits into
base: ked/master
Choose a base branch
from
Open

Tic Tac Toe #2

wants to merge 12 commits into from

Conversation

kedevlin
Copy link

Completed primary requirements

}

TicTacToe.prototype = {

function Player(number, name, marker) {

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

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

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