Format
There really is no hope of making this code even half-way decent without spending the time to rewrite them all properly. Don't want to do any of that
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#Import der Module
|
||||
# Import der Module
|
||||
import turtle
|
||||
import time
|
||||
import datetime
|
||||
|
||||
#Setup der einzelnen Turtle instanzen.
|
||||
# Setup der einzelnen Turtle instanzen.
|
||||
turtle.tracer(0)
|
||||
sekundenzeiger = turtle.Turtle()
|
||||
minutenzeiger = turtle.Turtle()
|
||||
@@ -13,7 +13,8 @@ sekundenzeiger.color("red")
|
||||
minutenzeiger.color("blue")
|
||||
stundenzeiger.width(2)
|
||||
|
||||
#Definition des Ziffernblattes
|
||||
|
||||
# Definition des Ziffernblattes
|
||||
def clock_bg():
|
||||
uhr.pd()
|
||||
uhr.dot(10)
|
||||
@@ -32,7 +33,8 @@ def clock_bg():
|
||||
uhr.rt(0.5)
|
||||
uhr.pu()
|
||||
|
||||
#Funktion des Sekundenzeigers
|
||||
|
||||
# Funktion des Sekundenzeigers
|
||||
def sekzeiger():
|
||||
sekundenzeiger.pu()
|
||||
sekundenzeiger.home()
|
||||
@@ -42,21 +44,21 @@ def sekzeiger():
|
||||
sekundenzeiger.lt(90)
|
||||
sekundenzeiger.bk(40)
|
||||
sekundenzeiger.fd(220)
|
||||
|
||||
|
||||
#Funktion des Minutenzeigers
|
||||
|
||||
|
||||
# Funktion des Minutenzeigers
|
||||
def minzeiger():
|
||||
minutenzeiger.pu()
|
||||
minutenzeiger.home()
|
||||
minutenzeiger.pd()
|
||||
minuten = datetime.datetime.now().minute
|
||||
minutenzeiger.lt((minuten * 6) *(-1))
|
||||
minutenzeiger.lt((minuten * 6) * (-1))
|
||||
minutenzeiger.lt(90)
|
||||
minutenzeiger.bk(30)
|
||||
minutenzeiger.fd(215)
|
||||
|
||||
|
||||
#Funktion des Stundenzeigers
|
||||
|
||||
|
||||
# Funktion des Stundenzeigers
|
||||
def stzeiger():
|
||||
stundenzeiger.pu()
|
||||
stundenzeiger.home()
|
||||
@@ -77,7 +79,8 @@ def stzeiger():
|
||||
stundenzeiger.bk(15)
|
||||
stundenzeiger.fd(135)
|
||||
|
||||
#Ganze Uhr
|
||||
|
||||
# Ganze Uhr
|
||||
def clock():
|
||||
sekundenzeiger.clear()
|
||||
minutenzeiger.clear()
|
||||
@@ -93,13 +96,14 @@ def clock():
|
||||
stzeiger()
|
||||
turtle.update()
|
||||
|
||||
#Stoppen der Uhr
|
||||
|
||||
# Stoppen der Uhr
|
||||
def stop():
|
||||
global run
|
||||
run = 0
|
||||
|
||||
|
||||
#Hauptschleife
|
||||
# Hauptschleife
|
||||
def settings():
|
||||
print("Welcome!")
|
||||
global run
|
||||
@@ -115,11 +119,10 @@ def settings():
|
||||
print("stopped, click to exit")
|
||||
turtle.exitonclick()
|
||||
print("process ended")
|
||||
|
||||
|
||||
|
||||
#Startzeit einblenden
|
||||
|
||||
|
||||
# Startzeit einblenden
|
||||
print(time.strftime("%H:%M:%S"))
|
||||
|
||||
#Ausführen des Programms
|
||||
# Ausführen des Programms
|
||||
settings()
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
|
||||
|
||||
addshape("testimage.gif")
|
||||
screensize(1080,1920)
|
||||
screensize(1080, 1920)
|
||||
shape("testimage.gif")
|
||||
color("red")
|
||||
speed(1000)
|
||||
|
||||
|
||||
def walk():
|
||||
w=10
|
||||
length=100
|
||||
w = 10
|
||||
length = 100
|
||||
for i in range(4):
|
||||
w += 10
|
||||
width(w)
|
||||
@@ -16,6 +18,7 @@ def walk():
|
||||
length += 40
|
||||
fd(length)
|
||||
rt(90)
|
||||
|
||||
|
||||
|
||||
walk()
|
||||
exitonclick()
|
||||
exitonclick()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from turtle import*
|
||||
from turtle import *
|
||||
import subprocess
|
||||
|
||||
subprocess.run(Kreis_zufall_pre.py)
|
||||
subprocess.run(Kreis_zufall_pre.py)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# Yes, that is called concat, but sure
|
||||
x = input("Wert x: ")
|
||||
y = input("Wert y: ")
|
||||
z = input("Wert z: ")
|
||||
@@ -11,5 +12,3 @@ while remaining > 1:
|
||||
start += 6
|
||||
ending += 6
|
||||
remaining -= 6
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from turtle import*
|
||||
# No, there is not in fact any recursion here
|
||||
from turtle import *
|
||||
|
||||
t1 = Turtle()
|
||||
t2 = Turtle()
|
||||
|
||||
|
||||
|
||||
go = 3
|
||||
t1.lt(90)
|
||||
t1.speed(1000)
|
||||
@@ -13,41 +13,41 @@ t1.ht()
|
||||
|
||||
def gogo():
|
||||
go = 2
|
||||
while go>1:
|
||||
if t1.xcor() < (window_width()/2 -50):
|
||||
while go > 1:
|
||||
if t1.xcor() < (window_width() / 2 - 50):
|
||||
for i in range(50):
|
||||
t1.fd(2)
|
||||
t1.rt(180/50)
|
||||
if t1.xcor() < (window_width()/2 -50):
|
||||
t1.rt(180 / 50)
|
||||
if t1.xcor() < (window_width() / 2 - 50):
|
||||
for i in range(50):
|
||||
t1.fd(2)
|
||||
t1.lt(180/50)
|
||||
|
||||
t1.lt(180 / 50)
|
||||
|
||||
else:
|
||||
print("done")
|
||||
print(xcor())
|
||||
go = 1
|
||||
|
||||
|
||||
while go>0 and go<2:
|
||||
if t1.xcor() > (window_width()/2 - window_width()/2 + 50):
|
||||
|
||||
while go > 0 and go < 2:
|
||||
if t1.xcor() > (window_width() / 2 - window_width() / 2 + 50):
|
||||
for i in range(50):
|
||||
t1.bk(2)
|
||||
t1.lt(180/50)
|
||||
if t1.xcor() > (window_width()/2 - window_width()/2 + 50):
|
||||
t1.lt(180 / 50)
|
||||
if t1.xcor() > (window_width() / 2 - window_width() / 2 + 50):
|
||||
for i in range(50):
|
||||
t1.bk(2)
|
||||
t1.rt(180/50)
|
||||
t1.rt(180 / 50)
|
||||
else:
|
||||
print("home")
|
||||
go = 0
|
||||
onkey(gogo, "space")
|
||||
print("ready")
|
||||
|
||||
|
||||
|
||||
t2.ht()
|
||||
|
||||
|
||||
onkey(gogo, "space")
|
||||
listen()
|
||||
|
||||
print("ready")
|
||||
|
||||
print("ready")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
|
||||
global mistakes
|
||||
mistakes = 0
|
||||
global wortelements
|
||||
@@ -6,10 +7,11 @@ wortelements = []
|
||||
global done
|
||||
done = []
|
||||
|
||||
|
||||
def clear_screen():
|
||||
os.system('cls')
|
||||
|
||||
|
||||
os.system("cls")
|
||||
|
||||
|
||||
def worteingabe():
|
||||
global wort
|
||||
wort = input("Suchen sie ein Wort, welches erraten werden soll, ein: ")
|
||||
@@ -17,17 +19,21 @@ def worteingabe():
|
||||
print("Vielen Dank. Das Wort wurde gespeichert.")
|
||||
print("Geben Sie das Gerät weiter.")
|
||||
ausgabe(wort)
|
||||
|
||||
|
||||
|
||||
def ausgabe(wort):
|
||||
global wortelements
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
Das Wort:
|
||||
""")
|
||||
print(len(wort)*"*")
|
||||
"""
|
||||
)
|
||||
print(len(wort) * "*")
|
||||
global wholewordlist
|
||||
wholewordlist = list(wort)
|
||||
wortelements = list(len(wort)*"*")
|
||||
wortelements = list(len(wort) * "*")
|
||||
|
||||
|
||||
def ersetzen(letter):
|
||||
global wort
|
||||
@@ -41,15 +47,17 @@ def ersetzen(letter):
|
||||
wortelements.pop(pos)
|
||||
wortelements.insert(pos, letter)
|
||||
|
||||
|
||||
|
||||
def raten():
|
||||
global wort
|
||||
global wortelements
|
||||
global wholewordlist
|
||||
global go
|
||||
global go
|
||||
go = 1
|
||||
while go == 1:
|
||||
buchstabe = input("Suchen sie einen Buchstaben aus, welcher sich im Wort befinden könnte: ")
|
||||
buchstabe = input(
|
||||
"Suchen sie einen Buchstaben aus, welcher sich im Wort befinden könnte: "
|
||||
)
|
||||
if buchstabe in wholewordlist:
|
||||
print("Der Buchstabe kommt hier vor:")
|
||||
ersetzen(buchstabe)
|
||||
@@ -59,7 +67,7 @@ def raten():
|
||||
print("Dieser Buchstabe wurde bereits eingetippt.")
|
||||
addman()
|
||||
elif buchstabe == wort:
|
||||
wholewordlist = list(len(wort)*"*")
|
||||
wholewordlist = list(len(wort) * "*")
|
||||
else:
|
||||
print("Dieser Buchstabe ist nicht Teil des Wortes")
|
||||
done.append(buchstabe)
|
||||
@@ -69,28 +77,33 @@ def raten():
|
||||
if len(wort) - counts <= 0:
|
||||
go = 0
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
DAS WORT WURDE GEFUNDEN
|
||||
Das Wort:
|
||||
""")
|
||||
"""
|
||||
)
|
||||
print(wort)
|
||||
|
||||
|
||||
|
||||
|
||||
def addman():
|
||||
global mistakes
|
||||
mistakes += 1
|
||||
if mistakes == 1:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
__________
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 2:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -98,9 +111,11 @@ def addman():
|
||||
|
||||
|
|
||||
_____|_____
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 3:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -108,9 +123,11 @@ def addman():
|
||||
|
|
||||
|
|
||||
_____|_____
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 4:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
|
||||
|
|
||||
@@ -118,9 +135,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 5:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
|
|
||||
|
|
||||
@@ -128,9 +147,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 6:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -138,9 +159,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 6:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -148,9 +171,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 7:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -158,9 +183,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 8:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -168,9 +195,11 @@ def addman():
|
||||
| /
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 9:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -181,13 +210,11 @@ def addman():
|
||||
|
||||
|
||||
DEAD
|
||||
""")
|
||||
"""
|
||||
)
|
||||
global go
|
||||
go = 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
worteingabe()
|
||||
raten()
|
||||
raten()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import time
|
||||
|
||||
print ("time.time(): %f " % time.time())
|
||||
print (time.localtime( time.time()))
|
||||
print (time.asctime( time.localtime(time.time())))
|
||||
print("time.time(): %f " % time.time())
|
||||
print(time.localtime(time.time()))
|
||||
print(time.asctime(time.localtime(time.time())))
|
||||
|
||||
Reference in New Issue
Block a user