Skip to content

Instantly share code, notes, and snippets.

@NimaBoscarino
Created December 11, 2015 15:14
Show Gist options
  • Save NimaBoscarino/5e75aff8358c072fabf8 to your computer and use it in GitHub Desktop.
Save NimaBoscarino/5e75aff8358c072fabf8 to your computer and use it in GitHub Desktop.
import sys
# input is just command line: R S T L
# e.g. 1 2 0 1 == 1 R, 2 S, 0 T, 1 L
# easy!
result = "no"
done = 0
minoes = sys.argv[1:]
# we're going to be unintelligent and hard-code the cases!
for elem in minoes:
if (int(elem) == 4):
result = "yes"
done = 1
elif (int(elem) == 3):
result = "no"
done = 1
print(minoes)
if not done:
check = (minoes[0] == '2') + (minoes[1] == '2') + (minoes[3] == '2')
if (check > 1):
result = "yes"
elif (minoes[3] == '2') and (minoes[2] == '0'):
result = "yes"
# this SHOULD cover all the cases, because there can't be a 1 1 1 1 case due to the T block
# if I consider cases other cases where T = 0 then I've already covered everything else
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment