Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2022 12:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
emojie animals racing in the terminal
import os
import time
import random
animals = "๐Ÿ…๐Ÿ†๐Ÿฆ“๐Ÿฆฃ๐Ÿ˜๐Ÿฆ›๐Ÿฆ๐Ÿช๐Ÿฆ’๐Ÿฆ˜๐Ÿฆฌ๐Ÿƒ๐Ÿ‚๐Ÿ„๐ŸŽ๐Ÿ–๐Ÿ๐Ÿฆ™๐Ÿ๐ŸฆŒ๐Ÿ•๐Ÿˆ๐Ÿ“๐Ÿ‡๐Ÿฆ"
#animals = "๐Ÿถ๐Ÿฑ๐Ÿญ๐Ÿฐ๐ŸฆŠ๐Ÿป๐Ÿผ๐Ÿฆ๐Ÿฏ๐Ÿจ๐Ÿป๐Ÿฎ"
width = os.get_terminal_size().columns - 2
pos = [width] * len(animals)
def main():
while min(pos) > 0:
for i, a in enumerate(animals):
pos[i] -= random.choice([0,1])
print(" " * pos[i], a)
winner = "".join([animals[i] for i, x in enumerate(pos) if x == min(pos)])
print("The Winner is:", winner, "๐Ÿ†๐ŸŽ‰")
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment