Initial release

This commit is contained in:
Francois JUMELLE
2021-05-03 22:32:40 +02:00
commit 20526d93c8
928 changed files with 452368 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import math
n = 142
direction = 0
x = 0
y = 0
avancer = 1
while n != 1:
print(n)
if n%2 == 1:
if n%3 == 0:
direction = direction + 1
else:
direction = direction - 1
else:
if direction%4 == 0:
y = y + avancer
elif direction%4 == 1:
x = x + avancer
elif direction%4 == 2:
y = y - avancer
else:
x = x - avancer
avancer = avancer + 1
if n%2 == 0:
n = n//2
else:
n = n * 3 + 1
print("Distance: ", 1000*math.sqrt(x*x+y*y))