ammmmmmmmmm
This commit is contained in:
parent
884af776fc
commit
20d4a8f432
3 changed files with 51 additions and 13 deletions
22
terminal engine/tengine.py
Normal file
22
terminal engine/tengine.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
from os import get_terminal_size
|
||||||
|
|
||||||
|
class tengine():
|
||||||
|
tx, ty = get_terminal_size().columns, get_terminal_size().lines
|
||||||
|
#feld = [[""]*10]*10
|
||||||
|
feld = [["","","",],["","","",],["","","",]]
|
||||||
|
test = 0
|
||||||
|
for a in feld:
|
||||||
|
for b in a:
|
||||||
|
print(test)
|
||||||
|
b = test
|
||||||
|
test +=1
|
||||||
|
print(feld)
|
||||||
|
def strfeld():
|
||||||
|
back = ""
|
||||||
|
for a in tengine.feld:
|
||||||
|
for b in a:
|
||||||
|
back += b
|
||||||
|
back += "\n"
|
||||||
|
return back
|
||||||
|
def addchar(character=str,position=list):
|
||||||
|
tengine.feld[2][2] = "a"
|
15
terminal engine/test.py
Normal file
15
terminal engine/test.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#from tengine import tengine
|
||||||
|
#tengine.addchar("a",[5,5])
|
||||||
|
#print(tengine.feld)
|
||||||
|
|
||||||
|
feld = [["","","",],["","","",],["","","",]]
|
||||||
|
feld[1][1] = "a"
|
||||||
|
test = 0
|
||||||
|
for a in feld:
|
||||||
|
for b in a:
|
||||||
|
print(test)
|
||||||
|
b = test
|
||||||
|
print(b)
|
||||||
|
test +=1
|
||||||
|
feld[1][1] = "a"
|
||||||
|
print(feld)
|
25
v1.py
25
v1.py
|
@ -3,12 +3,14 @@ import os
|
||||||
from pynput import keyboard
|
from pynput import keyboard
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
def clear():
|
def clear():
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
os.system("cls")
|
os.system("cls")
|
||||||
else:
|
else:
|
||||||
os.system("clear")
|
os.system("clear")
|
||||||
|
|
||||||
|
|
||||||
def on_press(key):
|
def on_press(key):
|
||||||
global running
|
global running
|
||||||
if key == keyboard.Key.space:
|
if key == keyboard.Key.space:
|
||||||
|
@ -21,9 +23,8 @@ def on_release(key):
|
||||||
# Stop listener
|
# Stop listener
|
||||||
running = "finito"
|
running = "finito"
|
||||||
|
|
||||||
listener = keyboard.Listener(
|
|
||||||
on_press=on_press,
|
listener = keyboard.Listener(on_press=on_press, on_release=on_release)
|
||||||
on_release=on_release)
|
|
||||||
|
|
||||||
listener.start()
|
listener.start()
|
||||||
|
|
||||||
|
@ -34,10 +35,10 @@ wobble_pos = 0
|
||||||
wobble_way = "right"
|
wobble_way = "right"
|
||||||
running = True
|
running = True
|
||||||
while running == True:
|
while running == True:
|
||||||
wobl = "-"*(tx-wobble_pos-5)
|
wobl = "-" * (tx - wobble_pos - 5)
|
||||||
wobr = "-"*wobble_pos
|
wobr = "-" * wobble_pos
|
||||||
wobbl = f"{wobr}🐄️{wobl}"
|
wobbl = f"{wobr}🐄️{wobl}"
|
||||||
print(" "*txhalb,"↓")
|
print(" " * txhalb, "↓")
|
||||||
print(f"[{wobbl}]")
|
print(f"[{wobbl}]")
|
||||||
print(wobble_pos)
|
print(wobble_pos)
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ while running == True:
|
||||||
else:
|
else:
|
||||||
wobble_pos -= 1
|
wobble_pos -= 1
|
||||||
|
|
||||||
if wobble_pos >= tx-1:
|
if wobble_pos >= tx - 1:
|
||||||
wobble_way = "left"
|
wobble_way = "left"
|
||||||
elif wobble_pos == 0:
|
elif wobble_pos == 0:
|
||||||
wobble_way = "right"
|
wobble_way = "right"
|
||||||
|
@ -65,10 +66,10 @@ else:
|
||||||
if wobble_site == "right":
|
if wobble_site == "right":
|
||||||
points = wobble_pos
|
points = wobble_pos
|
||||||
else:
|
else:
|
||||||
points = tx-wobble_pos
|
points = tx - wobble_pos
|
||||||
|
|
||||||
point_quote = points-tx/100
|
point_quote = points - tx / 100
|
||||||
for a in range(points*2):
|
for a in range(points * 2):
|
||||||
print("-"*a+"🐄️",end="\r")
|
print("-" * a + "🐄️", end="\r")
|
||||||
sleep(0.01)
|
sleep(0.01)
|
||||||
print("\n",point_quote,"%")
|
print("\n", point_quote, "%")
|
||||||
|
|
Loading…
Reference in a new issue