Name | labyrinthine JSON |
Version |
0.1.11
JSON |
| download |
home_page | |
Summary | A no-dependency library to generate mazes. |
upload_time | 2023-06-23 16:19:13 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.5 |
license | MIT License Copyright (c) 2023 Roberto Schiavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
maze
procedural-generation
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Labyrinthine
A no-dependency library to generate mazes.
![maze](https://raw.githubusercontent.com/robertoschiavone/labyrinthine/main/maze.png)
## Installation
```bash
pip install labyrinthine
```
## Usage
```python
import matplotlib.pyplot as plt
import numpy as np
from labyrinthine import depth_first
maze = depth_first(size=(31, 21))
plt.imshow(np.pad(maze, 1, constant_values=1), cmap="binary")
plt.axis("off")
plt.savefig("maze.png", bbox_inches="tight", pad_inches=0)
```
## Parameters
`depth_first` accepts the following parameters:
- `size`: either a pair of `int` specifying width and height of the maze, or a
single `int` for a square one.
- `start`: a pair of `int` defining the starting point. Default value is
`(0, 0)`, the top-left corner of the maze.
- `seed`: `int`, optional. Default value is `None`.
The output is an integer matrix of the requested size, where **1** represents a
filled cell, thus a wall, and **0** represents an empty cell, thus a passage.
> :warning: HEADS UP!
>
> Due to the nature of the algorithm, it is warmly recommended to use odd width
> and height values, so that the resulting matrix doesn't have a vertical and
> horizontal border entirely filled with walls.
## Development
`Makefile` is self-explanatory.
Raw data
{
"_id": null,
"home_page": "",
"name": "labyrinthine",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "Roberto Schiavone <hello@robertoschiavone.io>",
"keywords": "maze,procedural-generation",
"author": "",
"author_email": "Roberto Schiavone <hello@robertoschiavone.io>",
"download_url": "https://files.pythonhosted.org/packages/d0/9b/a00ce4cbc503d6d904951f20ded58a219dada1c0d243cde98eef379387ea/labyrinthine-0.1.11.tar.gz",
"platform": null,
"description": "# Labyrinthine\n\nA no-dependency library to generate mazes.\n\n![maze](https://raw.githubusercontent.com/robertoschiavone/labyrinthine/main/maze.png)\n\n## Installation\n\n```bash\npip install labyrinthine\n```\n\n## Usage\n\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom labyrinthine import depth_first\n\nmaze = depth_first(size=(31, 21))\nplt.imshow(np.pad(maze, 1, constant_values=1), cmap=\"binary\")\nplt.axis(\"off\")\nplt.savefig(\"maze.png\", bbox_inches=\"tight\", pad_inches=0)\n```\n\n## Parameters\n\n`depth_first` accepts the following parameters:\n\n- `size`: either a pair of `int` specifying width and height of the maze, or a\n single `int` for a square one.\n- `start`: a pair of `int` defining the starting point. Default value is\n `(0, 0)`, the top-left corner of the maze.\n- `seed`: `int`, optional. Default value is `None`.\n\nThe output is an integer matrix of the requested size, where **1** represents a\nfilled cell, thus a wall, and **0** represents an empty cell, thus a passage.\n\n> :warning: HEADS UP!\n>\n> Due to the nature of the algorithm, it is warmly recommended to use odd width\n> and height values, so that the resulting matrix doesn't have a vertical and\n> horizontal border entirely filled with walls.\n\n## Development\n\n`Makefile` is self-explanatory.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 Roberto Schiavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A no-dependency library to generate mazes.",
"version": "0.1.11",
"project_urls": {
"changelog": "https://github.com/robertoschiavone/labyrinthine/releases",
"documentation": "https://github.com/robertoschiavone/labyrinthine",
"homepage": "https://github.com/robertoschiavone/labyrinthine",
"repository": "https://github.com/robertoschiavone/labyrinthine.git"
},
"split_keywords": [
"maze",
"procedural-generation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1b5aa54c9c1895508f493b2e1c22ab0febc2eaa226c979d6a636641ed6ccdfff",
"md5": "3398e6161abaa7c0bd3c57ccae6b29a7",
"sha256": "47683c5349fa78776f73218319eceacb6dcd40b4acbddfd6217e808fce763e53"
},
"downloads": -1,
"filename": "labyrinthine-0.1.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3398e6161abaa7c0bd3c57ccae6b29a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 4775,
"upload_time": "2023-06-23T16:19:11",
"upload_time_iso_8601": "2023-06-23T16:19:11.317430Z",
"url": "https://files.pythonhosted.org/packages/1b/5a/a54c9c1895508f493b2e1c22ab0febc2eaa226c979d6a636641ed6ccdfff/labyrinthine-0.1.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d09ba00ce4cbc503d6d904951f20ded58a219dada1c0d243cde98eef379387ea",
"md5": "4158dc3676d346aa05c5306ccc32dc63",
"sha256": "3f9278e07c3c04c6616fceb6fdaedcb000dada96ca9facbacdacdab0fa57155c"
},
"downloads": -1,
"filename": "labyrinthine-0.1.11.tar.gz",
"has_sig": false,
"md5_digest": "4158dc3676d346aa05c5306ccc32dc63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 3644,
"upload_time": "2023-06-23T16:19:13",
"upload_time_iso_8601": "2023-06-23T16:19:13.005743Z",
"url": "https://files.pythonhosted.org/packages/d0/9b/a00ce4cbc503d6d904951f20ded58a219dada1c0d243cde98eef379387ea/labyrinthine-0.1.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-23 16:19:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "robertoschiavone",
"github_project": "labyrinthine",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "labyrinthine"
}