What I want my code to do is that eventually the "-" will collide with the "0". But right now all it does is keep chasing the "0" and never touch it.
import time
global gunshot, gun
gun = 0
gunshot = "- 0"
while True:
global gunshot
gunshot = " " + gunshot
gunshot.replace(' 0', '0')
print ('\r {0}'.format(gunshot)),
if gunshot.find("-0") == 1:
gunshot = "-"
time.sleep(.1)
That is want I want:
- 0
- 0
- 0
This is what it is doing
- 0
- 0
- 0
global gunshot, gun. That makes only sense if you are in a function and want to modify agunshotandgunvariable (which are outside of your function).