Skip to content

Commit 3a7e75f

Browse files
author
Christian Bender
committed
added a option for termination the program
1 parent a2b540f commit 3a7e75f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎hashes/chaos_machine.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
"""example of simple chaos machine"""
22
from __future__ importprint_function
33

4+
try:
5+
raw_input
6+
input=raw_input
7+
except:
8+
pass
9+
410
# Chaos Machine (K, t, m)
511
K= [0.33, 0.44, 0.55, 0.44, 0.33]; t=3; m=5
612

@@ -91,7 +97,11 @@ def reset():
9197
forchunkinmessage:
9298
push(chunk)
9399

100+
# for controlling
101+
inp=""
102+
94103
# Pulling Data (Output)
95-
whileTrue:
104+
whileinp!="e"andinp!="E":
96105
print("%s"%format(pull(), '#04x'))
97106
print(buffer_space); print(params_space)
107+
inp=input("(e)exit? ")

0 commit comments

Comments
(0)