Advertisement
fx16

défi Turing 84

May 27th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. from math import *
  2.  
  3. def distance(x,y):
  4.     return sqrt(x**2+y**2)
  5.    
  6. x,y=0,0
  7. N=1
  8.  
  9. while distance(x,y)<65000:
  10.     if N%4==0:
  11.         y-=N
  12.     elif N%3==0:
  13.         x-=N
  14.     elif N%2==0:
  15.         y+=N
  16.     else:
  17.         x+=N
  18.     N+=1
  19. print (x,y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement