-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8174ff
commit 8ba3622
Showing
6 changed files
with
51 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
"""MazeForge | ||
Contact: | ||
-------- | ||
""" | ||
MazeForge | ||
========= | ||
- [email protected] | ||
Provides | ||
1. Generation of mazes | ||
2. Solving of mazes | ||
3. Visualisation of mazes | ||
More information is available at: | ||
Contact | ||
- [email protected] | ||
- https://pypi.org/project/mazeforge/ | ||
- https://github.com/oskarmeyenburg/mazeforge | ||
More information | ||
- https://pypi.org/project/mazeforge/ | ||
- https://github.com/oskarmeyenburg/mazeforge | ||
""" | ||
from .generator import generate | ||
from .base import Maze | ||
|
||
|
||
__version__ = "0.1.0" | ||
__version__ = "0.1.0" | ||
__all__ = ['Maze', 'generate'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import numpy | ||
|
||
|
||
class Maze(numpy.ndarray): | ||
def __new__(cls, width, height): | ||
# Create a new array with the specified dimensions and fill value | ||
maze_array = numpy.full((height, width), 0, dtype=numpy.int_) | ||
obj = maze_array.view(cls) | ||
return obj | ||
|
||
@classmethod | ||
def from_array(cls, array): | ||
""" | ||
Create a new Maze instance from an existing NumPy array | ||
""" | ||
return array.view(cls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters