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

Towers of Hanoi Project #228

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

jacobecox
Copy link

No description provided.

[],
[]];

var currentBoard = board.map(function (peg) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in use.

});

function printBoard(){
console.log({board});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not logging correctly as stated in the instructions

Comment on lines +51 to +53
board[to].push(board[from].pop());
printBoard();
checkWinner();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code alignment

checkWinner();
}};

move(2, 2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this doing here?

// GAME RULES

function checkWinner() {
if (JSON.stringify(board) === JSON.stringify(winnerBoard1)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this approach is not maintainable. What if we want to give the users the option to decide how many pegs are supported? Then you will have to hardcode this.

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