1 parent a2b540f commit 3a7e75fCopy full SHA for 3a7e75f
1 file changed
hashes/chaos_machine.py
@@ -1,6 +1,12 @@
1
"""example of simple chaos machine"""
2
from __future__ import print_function
3
4
+try:
5
+ raw_input
6
+ input = raw_input
7
+except:
8
+ pass
9
+
10
# Chaos Machine (K, t, m)
11
K = [0.33, 0.44, 0.55, 0.44, 0.33]; t = 3; m = 5
12
@@ -91,7 +97,11 @@ def reset():
91
97
for chunk in message:
92
98
push(chunk)
93
99
100
+# for controlling
101
+inp = ""
102
94
103
# Pulling Data (Output)
95
-while True:
104
+while inp != "e" and inp != "E":
96
105
print("%s" % format(pull(), '#04x'))
106
print(buffer_space); print(params_space)
107
+ inp = input("(e)exit? ")
0 commit comments