Updated 2017/18

This commit is contained in:
FrederikBaerentsen 2024-11-27 06:38:22 +01:00
parent 68c005577b
commit bfb1ae0d73

View File

@ -43,30 +43,41 @@ if part == 1:
print(i) print(i)
if i[0] == 'set': if i[0] == 'set':
sets[i[1]] = i[2] if isinstance(i[2], str):
sets[i[1]] = int(i[2])
else:
sets[i[1]] = int(sets[i[2]])
x += 1
elif i[0] == 'add': elif i[0] == 'add':
sets[i[1]] = int(sets[i[1]]) + int(i[2]) sets[i[1]] = int(sets[i[1]]) + int(i[2])
x += 1
elif i[0] == 'mul': elif i[0] == 'mul':
if i[2] in sets: if i[2] in sets:
sets[i[1]] = int(sets[i[1]]) * int(sets[i[2]]) sets[i[1]] = int(sets[i[1]]) * int(sets[i[2]])
else: else:
sets[i[1]] = int(sets[i[1]]) * int(i[2]) sets[i[1]] = int(sets[i[1]]) * int(i[2])
x += 1
elif i[0] == 'mod': elif i[0] == 'mod':
sets[i[1]] = int(sets[i[1]]) % int(i[2]) sets[i[1]] = int(sets[i[1]]) % int(i[2])
x += 1
elif i[0] == 'snd': elif i[0] == 'snd':
last_sound = sets[i[1]] last_sound = sets[i[1]]
x += 1
elif i[0] == 'rcv': elif i[0] == 'rcv':
if sets[i[1]] != 0: if sets[i[1]] != 0:
sets[i[1]] = int(sets[i[1]]) sets[i[1]] = int(sets[i[1]])
x += 1
else: else:
print('skipped') print('skipped')
x += 1
if i[0] == 'jgz': elif i[0] == 'jgz': #this is the one that fails
if isinstance(i[2], str): if isinstance(i[2], str):
if sets[i[1]] > 0: if sets[i[1]] > 0:
@ -75,8 +86,7 @@ if part == 1:
x += int(i[2]) x += int(i[2])
else: else:
x += 1 x += 1
else:
x += 1