Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Guess(a,b):
- a=0
- b=0
- cnt=0
- while True:
- yield a+cnt*b
- if(b==0 and a<=0):
- b=-a+1
- a=0
- elif(b==0 and a>0):
- a=-a
- elif(b>0):
- b=-b
- elif(b<0 and a>0):
- a=-a
- b=-b
- elif(b<0 and a<=0):
- a=-a+1
- b=-b-1
- cnt = cnt+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement