1
- """ example of simple chaos machine
2
- Simple Chaos Machine refers to computational model
3
- that demonstrates chaotic behavior. It takes input values,
4
- applies a chaotic transformation using control theory
5
- principles, and generates unpredictable output ( meaning
6
- small changes in input lead to drastically different outputs
7
- over time),"""
1
+ """example of simple chaos machine
2
+ Simple Chaos Machine refers to computational model
3
+ that demonstrates chaotic behavior. It takes input values,
4
+ applies a chaotic transformation using control theory
5
+ principles, and generates unpredictable output ( meaning
6
+ small changes in input lead to drastically different outputs
7
+ over time),"""
8
8
9
9
""" Chaos Machine (K, t, m)
10
10
K --> Initial values for the buffer space.
15
15
t = 3
16
16
m = 5
17
17
18
- # Buffer Space (with Parameters Space)
18
+ # Buffer Space (with Parameters Space)
19
19
# --> Stores values undergoing chaotic transformation.
20
20
buffer_space : list [float ] = []
21
21
22
22
# Stores parameters controlling the transformation.
23
23
params_space : list [float ] = []
24
24
25
- # Machine Time
25
+ # Machine Time
26
26
# --> Keeps track of execution time.
27
27
machine_time = 0
28
28
29
- """The push() function updates the buffer_space and
29
+ """The push() function updates the buffer_space and
30
30
params_space by applying chaotic transformations
31
- based on control theory. It modifies all values in the
32
- buffer_space using an orbit change and trajectory
33
- change formula, which ensure values to stay within
34
- controlled chaotic limits. Finally, it increments
31
+ based on control theory. It modifies all values in the
32
+ buffer_space using an orbit change and trajectory
33
+ change formula, which ensure values to stay within
34
+ controlled chaotic limits. Finally, it increments
35
35
machine_time."""
36
+
37
+
36
38
def push (seed ):
37
39
global buffer_space , params_space , machine_time , K , m , t
38
40
@@ -59,13 +61,14 @@ def push(seed):
59
61
machine_time += 1
60
62
61
63
62
- """The pull() function generates a chaotic pseudo-random
63
- number using a logistic map transformation and the
64
- Xorshift algorithm. It updates buffer_space and params_space
65
- over multiple iterations, ensuring chaotic evolution. Finally,
66
- it selects two chaotic values, applies Xorshift, and returns a
64
+ """The pull() function generates a chaotic pseudo-random
65
+ number using a logistic map transformation and the
66
+ Xorshift algorithm. It updates buffer_space and params_space
67
+ over multiple iterations, ensuring chaotic evolution. Finally,
68
+ it selects two chaotic values, applies Xorshift, and returns a
67
69
32-bit random number."""
68
70
71
+
69
72
def pull ():
70
73
global buffer_space , params_space , machine_time , K , m , t
71
74
@@ -126,4 +129,4 @@ def reset():
126
129
print (f"{ format (pull (), '#04x' )} " )
127
130
print (buffer_space )
128
131
print (params_space )
129
- inp = input ("(e)exit? " ).strip ()
132
+ inp = input ("(e)exit? " ).strip ()
0 commit comments