We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56e2c9a commit b27e02cCopy full SHA for b27e02c
1 file changed
cellular_automata/von_neumann.py
@@ -14,10 +14,13 @@
14
Requirements: numpy, matplotlib
15
"""
16
17
-import numpy as np
18
-from matplotlib import animation
+import sys
+import doctest
19
+
20
import matplotlib.pyplot as plt
21
+from matplotlib import animation
22
from matplotlib.colors import ListedColormap
23
+import numpy as np
24
25
26
def create_random_grid(
@@ -737,15 +740,11 @@ def quick_demo(rule_name: str = "conway") -> None:
737
740
738
741
739
742
if __name__ == "__main__":
- import doctest
-
743
# Run doctests
744
print("Running doctests...")
745
doctest.testmod(verbose=True)
746
747
# Check if this is being run interactively or with specific demo request
- import sys
748
749
if len(sys.argv) > 1:
750
# Command line usage: python von_neumann.py demo
751
if sys.argv[1] == "demo":
0 commit comments