Files
pyDefis/Herculito 7 Le taureau de Crète.py
Francois JUMELLE 20526d93c8 Initial release
2021-05-03 22:32:40 +02:00

28 lines
450 B
Python

data = 'DG'
repeat = 10
rep = {'D':'DAGAGA', 'G':'GADADA', 'A': 'AA'}
for i in range(repeat):
data = "".join([rep[c] for c in data])
d = 0 #0=nord, 1=est, 2=sud, 3=ouest,
y = 0
x = 0
for c in data:
if c == 'A':
if d == 0:
y+=10
elif d == 1:
x+=10
elif d == 2:
y-=10
else:
x-=10
elif c == 'D':
d = (d+1)%4
else:
d = (d-1)%4
print(y,x)