Skip to main content

Setuptools setup.py for mazepy.

Project description

Maze classes for Python. Translated from Ruby sources in the book “Mazes for Programmers” by Jamis Buck (https://pragprog.com/book/jbmaze/mazes-for-programmers).

Includes additional code not in the aforementioned book.

Requirements

Python 3.

Install

Install latest version: pip install mazepy.

Usage

Use with other programs like this:

from mazepy import mazepy

grid=mazepy.Grid(10,20)
grid=mazepy.getRandomMaze(grid)
print("%s Maze:" % grid.algorithm)
print(grid)

and output of the above program would be similar to:

Recursive Backtracker Maze:
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|       |               |                   |               |           |       |
+   +   +   +---+---+   +   +   +---+---+---+   +---+   +   +   +---+---+   +   +
|   |   |   |           |   |       |           |       |   |               |   |
+   +---+   +---+---+---+---+   +   +   +---+---+   +---+   +---+   +---+---+   +
|       |       |           |   |           |       |   |       |       |       |
+   +   +---+   +   +   +   +---+---+---+---+   +---+   +---+   +---+---+   +---+
|   |       |   |   |   |           |           |   |       |           |       |
+   +---+   +   +   +   +---+---+   +   +---+---+   +   +   +---+---+   +   +   +
|   |       |   |   |   |       |   |   |           |   |           |   |   |   |
+   +   +   +   +---+   +---+   +   +   +   +   +---+   +---+---+   +   +   +   +
|   |   |   |       |   |       |   |   |   |   |       |   |       |   |   |   |
+   +   +---+---+   +   +   +---+   +   +   +---+   +---+   +   +---+   +---+   +
|   |           |       |   |       |   |       |           |       |           |
+   +---+---+   +---+---+   +   +---+   +   +   +---+---+   +---+   +---+---+   +
|           |       |           |       |   |           |   |   |       |       |
+---+---+   +---+   +   +---+---+   +---+   +---+---+   +   +   +   +   +   +---+
|       |   |       |   |           |   |       |       |       |   |   |       |
+   +---+   +   +---+   +---+---+   +   +---+   +   +---+---+   +   +---+---+   +
|           |                       |           |               |               |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

See also: mazingame (https://github.com/samisalkosuo/mazingame)

License

The MIT license for my own code.

Original Ruby code:

#---
# Excerpted from "Mazes for Programmers",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http://www.pragmaticprogrammer.com/titles/jbmaze for more book information.
#---

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mazepy-0.3.tar.gz (7.8 kB) Copy SHA256 hash SHA256 Source None Feb 9, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page