Skip to content

Commit 0d0968c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0466591 commit 0d0968c

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

Diff for: hashes/chaos_machine.py

+23-20
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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),"""
88

99
""" Chaos Machine (K, t, m)
1010
K --> Initial values for the buffer space.
@@ -15,24 +15,26 @@
1515
t = 3
1616
m = 5
1717

18-
# Buffer Space (with Parameters Space)
18+
# Buffer Space (with Parameters Space)
1919
# --> Stores values undergoing chaotic transformation.
2020
buffer_space: list[float] = []
2121

2222
# Stores parameters controlling the transformation.
2323
params_space: list[float] = []
2424

25-
# Machine Time
25+
# Machine Time
2626
# --> Keeps track of execution time.
2727
machine_time = 0
2828

29-
"""The push() function updates the buffer_space and
29+
"""The push() function updates the buffer_space and
3030
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
3535
machine_time."""
36+
37+
3638
def push(seed):
3739
global buffer_space, params_space, machine_time, K, m, t
3840

@@ -59,13 +61,14 @@ def push(seed):
5961
machine_time += 1
6062

6163

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
6769
32-bit random number."""
6870

71+
6972
def pull():
7073
global buffer_space, params_space, machine_time, K, m, t
7174

@@ -126,4 +129,4 @@ def reset():
126129
print(f"{format(pull(), '#04x')}")
127130
print(buffer_space)
128131
print(params_space)
129-
inp = input("(e)exit? ").strip()
132+
inp = input("(e)exit? ").strip()

0 commit comments

Comments
 (0)