-
Notifications
You must be signed in to change notification settings - Fork 0
fixed isValid function - regexp not being used correctly #1
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
|
Added comments, factored the validity test to '.slice().pop()', replaced last var with let. |
|
Mistakenly closed. |
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.
Nice job, just a couple of changes to make before you merge! I like the code plan in here.
| // of the disks are initially placed on peg 'a' and must be placed in order | ||
| // on either peg 'b' or 'c' to solve the puzzle. | ||
|
|
||
| let stacks = { |
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.
should be a const
| return true; | ||
| } | ||
| return win; | ||
| return false; |
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.
return false is unnecessary
Improved upon the original Towers of Hanoi that was uploaded directly to the master. Added isValid function to ensure input is valid. Initially used regexp comparison, but needed to change function to confirm validity through simple string comparisons.