add to gothib
This commit is contained in:
commit
523f45b46a
28 changed files with 419 additions and 0 deletions
20
secret_instructions.py
Normal file
20
secret_instructions.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
last_direction = None
|
||||
|
||||
while True:
|
||||
instruction = input()
|
||||
|
||||
if instruction == "99999":
|
||||
break
|
||||
|
||||
direction = int(instruction[0]) + int(instruction[1])
|
||||
amount = int(instruction[2:])
|
||||
|
||||
if amount == 0:
|
||||
direction = last_direction
|
||||
|
||||
if direction % 2 == 0:
|
||||
print("right", amount)
|
||||
else:
|
||||
print("left", amount)
|
||||
|
||||
last_direction = direction
|
Loading…
Add table
Add a link
Reference in a new issue