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)
|
27
v1.py
27
v1.py
|
@ -3,27 +3,28 @@ import os
|
|||
from pynput import keyboard
|
||||
from time import sleep
|
||||
|
||||
|
||||
def clear():
|
||||
if os.name == "nt":
|
||||
os.system("cls")
|
||||
else:
|
||||
os.system("clear")
|
||||
|
||||
|
||||
def on_press(key):
|
||||
global running
|
||||
if key == keyboard.Key.space:
|
||||
running = False
|
||||
|
||||
|
||||
|
||||
def on_release(key):
|
||||
global running
|
||||
if key == keyboard.Key.esc:
|
||||
# Stop listener
|
||||
running = "finito"
|
||||
|
||||
listener = keyboard.Listener(
|
||||
on_press=on_press,
|
||||
on_release=on_release)
|
||||
|
||||
listener = keyboard.Listener(on_press=on_press, on_release=on_release)
|
||||
|
||||
listener.start()
|
||||
|
||||
|
@ -34,10 +35,10 @@ wobble_pos = 0
|
|||
wobble_way = "right"
|
||||
running = True
|
||||
while running == True:
|
||||
wobl = "-"*(tx-wobble_pos-5)
|
||||
wobr = "-"*wobble_pos
|
||||
wobl = "-" * (tx - wobble_pos - 5)
|
||||
wobr = "-" * wobble_pos
|
||||
wobbl = f"{wobr}🐄️{wobl}"
|
||||
print(" "*txhalb,"↓")
|
||||
print(" " * txhalb, "↓")
|
||||
print(f"[{wobbl}]")
|
||||
print(wobble_pos)
|
||||
|
||||
|
@ -46,7 +47,7 @@ while running == True:
|
|||
else:
|
||||
wobble_pos -= 1
|
||||
|
||||
if wobble_pos >= tx-1:
|
||||
if wobble_pos >= tx - 1:
|
||||
wobble_way = "left"
|
||||
elif wobble_pos == 0:
|
||||
wobble_way = "right"
|
||||
|
@ -65,10 +66,10 @@ else:
|
|||
if wobble_site == "right":
|
||||
points = wobble_pos
|
||||
else:
|
||||
points = tx-wobble_pos
|
||||
points = tx - wobble_pos
|
||||
|
||||
point_quote = points-tx/100
|
||||
for a in range(points*2):
|
||||
print("-"*a+"🐄️",end="\r")
|
||||
point_quote = points - tx / 100
|
||||
for a in range(points * 2):
|
||||
print("-" * a + "🐄️", end="\r")
|
||||
sleep(0.01)
|
||||
print("\n",point_quote,"%")
|
||||
print("\n", point_quote, "%")
|
||||
|
|
Loading…
Reference in a new issue