Skip to content

Commit fb60eca

Browse files
committed
Fix
1 parent 057af61 commit fb60eca

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cellular_automata/wa_tor.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
Wa-Tor algorithm (1984)
33
44
@ https://en.wikipedia.org/wiki/Wa-Tor
5+
56
@ https://beltoforion.de/en/wator/
7+
68
@ https://beltoforion.de/en/wator/images/wator_medium.webm
79
810
This solution aims to completely remove any systematic approach
@@ -97,8 +99,8 @@ class WaTor:
9799
98100
:attr time_passed: A function that is called every time
99101
time passes (a chronon) in order to visually display
100-
the new Wa-Tor planet. The time_passed function can block
101-
using time.sleep to slow the algorithm progression.
102+
the new Wa-Tor planet. The `time_passed` function can block
103+
using `time.sleep` to slow the algorithm progression.
102104
103105
>>> wt = WaTor(10, 15)
104106
>>> wt.width
@@ -216,7 +218,7 @@ def get_surrounding_prey(self, entity: Entity) -> list[Entity]:
216218
"""
217219
Returns all the prey entities around (N, S, E, W) a predator entity.
218220
219-
Subtly different to the try_to_move_to_unoccupied square.
221+
Subtly different to the `move_and_reproduce`.
220222
221223
>>> wt = WaTor(WIDTH, HEIGHT)
222224
>>> wt.set_planet([
@@ -260,7 +262,7 @@ def move_and_reproduce(
260262
"""
261263
Attempts to move to an unoccupied neighbouring square
262264
in either of the four directions (North, South, East, West).
263-
If the move was successful and the remaining_reproduction time is
265+
If the move was successful and the `remaining_reproduction_time` is
264266
equal to 0, then a new prey or predator can also be created
265267
in the previous square.
266268
@@ -430,7 +432,7 @@ def perform_predator_actions(
430432

431433
def run(self, *, iteration_count: int) -> None:
432434
"""
433-
Emulate time passing by looping iteration_count times
435+
Emulate time passing by looping `iteration_count` times
434436
435437
>>> wt = WaTor(WIDTH, HEIGHT)
436438
>>> wt.run(iteration_count=PREDATOR_INITIAL_ENERGY_VALUE - 1)
@@ -488,6 +490,7 @@ def visualise(wt: WaTor, iter_number: int, *, colour: bool = True) -> None:
488490
the predators and prey.
489491
490492
(0x60f197) Prey = #
493+
491494
(0xfffff) Predator = x
492495
493496
>>> wt = WaTor(30, 30)

0 commit comments

Comments
 (0)