Initial commit

This commit is contained in:
Anthony Wang 2022-10-14 11:07:26 -04:00
commit f0a38e712f
Signed by: a
GPG key ID: 42A5B952E6DD8D38
2 changed files with 26 additions and 0 deletions

22
flipper.py Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/python
from sys import argv
mem = [{}, {}]
def flip(x, y):
if y not in mem[x]:
mem[x][y] = 1
else:
mem[x][y] = 1 - mem[x][y]
return mem[x][y]
with open(argv[1]) as f:
for line in f.readlines():
l = list(map(int, line.split()))
if len(l) < 2:
continue
x = l[0]
for i in range(1, len(l)):
x = flip(x, l[i])
print(x)

4
test.f Normal file
View file

@ -0,0 +1,4 @@
0 0
0 0
0 0
0 0