Skip to content

Instantly share code, notes, and snippets.

@nibrahim
Created May 10, 2021 19:30
Show Gist options
  • Save nibrahim/4e80922324f70922b8c02b3b5a11dbab to your computer and use it in GitHub Desktop.
Save nibrahim/4e80922324f70922b8c02b3b5a11dbab to your computer and use it in GitHub Desktop.

Revisions

  1. nibrahim created this gist May 10, 2021.
    17 changes: 17 additions & 0 deletions mystery.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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