Skip to content

Commit c7281c9

Browse files
committed
Make cave generator example more clear.
This version works better if the input isn't a boolean array.
1 parent 8e93460 commit c7281c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/cavegen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def convolve(tiles: np.array, wall_rule: int = 5) -> np.array:
2020
"""
2121
# Use convolve2d, the 2nd input is a 3x3 ones array.
2222
neighbors = scipy.signal.convolve2d(
23-
~tiles, [[1, 1, 1], [1, 1, 1], [1, 1, 1]], "same"
23+
tiles == 0, [[1, 1, 1], [1, 1, 1], [1, 1, 1]], "same"
2424
)
2525
return neighbors < wall_rule # Apply the wall rule.
2626

0 commit comments

Comments
 (0)