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
41 lines
664 B
Python
Executable File
41 lines
664 B
Python
Executable File
import random
|
|
|
|
|
|
st1 = 0
|
|
st2 = 0
|
|
st3 = 3
|
|
st2a = 0
|
|
anzahl = 0
|
|
|
|
go = 1
|
|
|
|
|
|
while go == 1:
|
|
zahl = random.randint(1, 2)
|
|
|
|
if st1 == st2:
|
|
if st2a == st3:
|
|
go = 0
|
|
else:
|
|
anzahl += 1
|
|
st3 = st2
|
|
st2 = st1
|
|
st2a = st1
|
|
st1 = zahl
|
|
if zahl == 1:
|
|
print("K")
|
|
else:
|
|
print("N")
|
|
|
|
else:
|
|
anzahl += 1
|
|
st3 = st2
|
|
st2 = st1
|
|
st2a = st1
|
|
st1 = zahl
|
|
if zahl == 1:
|
|
print("K")
|
|
else:
|
|
print("N")
|
|
print("Took", anzahl, "tries")
|