Created
August 10, 2014 21:14
-
-
Save makefunstuff/a63324d3faa07360ed52 to your computer and use it in GitHub Desktop.
Finally
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
from re import findall | |
array = [10, 2, 14, 7, 8, 12, 15, 11, 0, 4, 1, 13, 3, 9, 6] | |
def phase_5(): | |
a, b = map(lambda x: int(x), findall("\d+", raw_input())) | |
a &= 0xf | |
if a != 0xf: | |
c, d = 0, 0 | |
while True: | |
d += 1 | |
a = array[a] | |
c += a | |
if a == 0xf: | |
break | |
if d == 15 or c == b: | |
return | |
print "BOOM" | |
if __name__ == '__main__': | |
phase_5() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment