-
Notifications
You must be signed in to change notification settings - Fork 238
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
base: master
Are you sure you want to change the base?
Conversation
[], | ||
[]]; | ||
|
||
var currentBoard = board.map(function (peg) { |
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.
not in use.
}); | ||
|
||
function printBoard(){ | ||
console.log({board}); |
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.
not logging correctly as stated in the instructions
board[to].push(board[from].pop()); | ||
printBoard(); | ||
checkWinner(); |
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.
code alignment
checkWinner(); | ||
}}; | ||
|
||
move(2, 2); |
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.
what is this doing here?
// GAME RULES | ||
|
||
function checkWinner() { | ||
if (JSON.stringify(board) === JSON.stringify(winnerBoard1)) { |
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.
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.
No description provided.