Created
May 13, 2017 15:11
-
-
Save peat-psuwit/68df8938ea8da4dc0fee2cba9b905991 to your computer and use it in GitHub Desktop.
Robot can walk 3/5 units at a time. Can it walk N units?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkWays(0). | |
checkWays(N) :- | |
N >= 5, | |
M is N - 5, | |
checkWays(M). | |
checkWays(N) :- | |
N >= 3, | |
M is N - 3, | |
checkWays(M). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment