Skip to content

toumix/maze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Example:

>>> from maze import Maze, N, S, E, W
>>> m = Maze(size=(15, 15))
>>> print(m)
+   +-------------------+---------------+-----------+-------+
| v |                   |               |           |       |
|   +---+-----------+   +---+---+   +   |   +---+---+   +---+
|   |   |           |       |       |   |       |       |   |
|   |   +---+   +---+---+   +---+   +---+   +---+   +---+   |
|   |                               |                       |
|   +-------+-------+---+   +   +   +---+   +   +   +   +---+
|   |       |       |       |   |           |   |   |       |
|   +---+   +---+   +---+   |   +-------+   +---+---+---+---+
|           |       |       |   |                       |   |
+-------+   +---+   +-------+   |   +   +   +-----------+   |
|                   |       |   |   |   |                   |
|   +-----------+   +   +---+---+   |   +---+---+   +---+   |
|   |                               |       |   |       |   |
|   |   +   +   +   +   +   +---+   |   +---+   |   +---+---+
|   |   |   |   |   |   |   |       |       |   |           |
|   +---+---+   |   +---+---+   +---+   +   +   |   +   +---+
|   |           |   |   |   |   |       |       |   |   |   |
+---+   +---+   |   |   +   +---+   +   |   +   +---+---+   |
|       |   |   |   |               |   |   |               |
+---+   |   +   +---+-------+-------+   +---+   +---+   +   |
|       |       |           |               |       |   |   |
+-------+-------+-------+   +-------+   +---+---+   +---+   |
|                                               |   |       |
|   +   +   +---+   +   +---+   +---+   +-------+   |   +   |
|   |   |   |       |   |       |       |           |   |   |
+---+   |   +-------+---+   +   +---+   +---+   +---+   +---+
|       |   |               |       |   |       |           |
|   +---+---+   +-----------+   +---+   +---+   |   +   +   |
|           |   |                   |   |       |   |   |   |
+-----------+---+-------------------+---+-------+---+---+   |

>>> for d in [S, S, S, S, E, E, N, W]:
...     m.move(d)
>>> print(m)
+   +-------------------+---------------+-----------+-------+
| x |                   |               |           |       |
|   +---+-----------+   +---+---+   +   |   +---+---+   +---+
| x |   |           |       |       |   |       |       |   |
|   |   +---+   +---+---+   +---+   +---+   +---+   +---+   |
| x |                               |                       |
|   +-------+-------+---+   +   +   +---+   +   +   +   +---+
| x | <   x |       |       |   |           |   |   |       |
|   +---+   +---+   +---+   |   +-------+   +---+---+---+---+
| x   x   x |       |       |   |                       |   |
+-------+   +---+   +-------+   |   +   +   +-----------+   |
|                   |       |   |   |   |                   |
|   +-----------+   +   +---+---+   |   +---+---+   +---+   |
|   |                               |       |   |       |   |
|   |   +   +   +   +   +   +---+   |   +---+   |   +---+---+
|   |   |   |   |   |   |   |       |       |   |           |
|   +---+---+   |   +---+---+   +---+   +   +   |   +   +---+
|   |           |   |   |   |   |       |       |   |   |   |
+---+   +---+   |   |   +   +---+   +   |   +   +---+---+   |
|       |   |   |   |               |   |   |               |
+---+   |   +   +---+-------+-------+   +---+   +---+   +   |
|       |       |           |               |       |   |   |
+-------+-------+-------+   +-------+   +---+---+   +---+   |
|                                               |   |       |
|   +   +   +---+   +   +---+   +---+   +-------+   |   +   |
|   |   |   |       |   |       |       |           |   |   |
+---+   |   +-------+---+   +   +---+   +---+   +---+   +---+
|       |   |               |       |   |       |           |
|   +---+---+   +-----------+   +---+   +---+   |   +   +   |
|           |   |                   |   |       |   |   |   |
+-----------+---+-------------------+---+-------+---+---+   |

About

python maze implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages