Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def Guess(a,b):
  2.     a=0
  3.     b=0
  4.     cnt=0
  5.     while True:
  6.         yield a+cnt*b
  7.         if(b==0 and a<=0):
  8.             b=-a+1
  9.             a=0
  10.         elif(b==0 and a>0):
  11.             a=-a
  12.         elif(b>0):
  13.             b=-b
  14.         elif(b<0 and a>0):
  15.             a=-a
  16.             b=-b
  17.         elif(b<0 and a<=0):
  18.             a=-a+1
  19.             b=-b-1
  20.         cnt = cnt+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement