Created
May 10, 2021 19:30
-
-
Save nibrahim/4e80922324f70922b8c02b3b5a11dbab to your computer and use it in GitHub Desktop.
Example program for genskill bootcamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
l = 20 | |
q = ['.']*l | |
i = 0 | |
f = 1 | |
while True: | |
i+=1 | |
p = q[:] | |
m = q[:] | |
x = i%(l-2) | |
p[x], p[x-1], p[x+1], p[x-2], p[x+2] = ["0", "O", "O", 'o', "o"] | |
print ("".join(p), end="", flush=True) | |
time.sleep(0.05*f) | |
print ("\r", end="", flush=True) | |
if i%l == 0: f += 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment