Made it usable as module.

This commit is contained in:
The Wobbler 2023-12-29 18:54:39 +01:00
parent d085bd72af
commit b8369e0bf8

View file

@ -56,11 +56,14 @@ def berechneflugbahn(cow, xmin, xmax, ymin, ymax, startwinkel, startgeschwindigk
# some useful control # some useful control
clear, home, curoff, curon = "'\x1b[2J\x1b[H", "\x1b[H", "\x1b[?25l", "\x1b[?25h" clear, home, curoff, curon = "'\x1b[2J\x1b[H", "\x1b[H", "\x1b[?25l", "\x1b[?25h"
# set position of cursor # set position of cursor
def curpos(x, y): def curpos(x, y):
print("\033[%d;%dH" % (ymax - y, x), end="", flush=True) print("\033[%d;%dH" % (ymax - y, x), end="", flush=True)
if __name__ == "__main__":
# Randomly choose a cow # Randomly choose a cow
cows = "🐵🐒🦍🦧🐕🐯🦝🐩🐅🐴🐎🦄🦌🐗🐂🐃🐄🐪🐫🦙🦒🐹🦘🦡🐧🕊️ 🦅🦆🦉🐍🦎🐊🦜🦚🦩🐲🐉🦕" cows = "🐵🐒🦍🦧🐕🐯🦝🐩🐅🐴🐎🦄🦌🐗🐂🐃🐄🐪🐫🦙🦒🐹🦘🦡🐧🕊️ 🦅🦆🦉🐍🦎🐊🦜🦚🦩🐲🐉🦕"
cowlistlength = len(cows) cowlistlength = len(cows)