-
Notifications
You must be signed in to change notification settings - Fork 0
Adding partnerChallenge.js and towers of Hanoi #5
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
base: gh-pages
Are you sure you want to change the base?
Conversation
reneemeyer
left a comment
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.
Craig, nice job! Love love love the code plan and your comments. MTS.
| // Tests to make sure user entries are only a, b, or c. | ||
| const validUserEntry = (myStack) => { | ||
| const validStacksArr = ['a','b','c']; | ||
| return validStacksArr.some(validStack => myStack === validStack); |
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.
nice method!
| getPrompt(); | ||
| // I wrapped towersOfHanoi function around a condition so I can "end" the game. towersOfHanoi returns TRUE if someone | ||
| // won the game. It returns FALSE if the game is still going on. | ||
| if (!towersOfHanoi(startStack, endStack)) { |
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 is a really nice idea
| } | ||
| return false; | ||
| // stacks.b.length === winCount || stacks.c.length === winCount ? (return true) : (return false); | ||
| return stacks.b.length === winCount || stacks.c.length === winCount; |
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.
Please remove dead code.
Nice, concise win checkForWin() statement otherwise.
Week 3a (Tue class)