RandomMaze

This module provides a base class for random mazes. It extends Maze to create a specific type of maze with random cells, walls, and mud. However, it does not implement the maze generation algorithm itself and is meant to be subclassed.

class RandomMaze.RandomMaze(cell_percentage, wall_percentage, mud_percentage, mud_range=None, random_seed=None, *args, **kwargs)[source]

(This class inherits from Maze ).

A random maze is a maze that is created randomly. You can specify the size of the maze, the density of cells, walls, and mud, and the range of the mud values. You can also specify a random seed to reproduce the same maze later.

__init__(cell_percentage, wall_percentage, mud_percentage, mud_range=None, random_seed=None, *args, **kwargs)[source]

(This class is abstract and meant to be subclassed, not instantiated directly).

Initializes a new instance of the class.

Parameters:
  • cell_percentage (float) – Percentage of cells to be reachable.

  • wall_percentage (float) – Percentage of walls to be present.

  • mud_percentage (float) – Percentage of mud to be present.

  • mud_range (tuple[int, int] | None) – Range of the mud values (optional if mud_percentage = 0.0).

  • random_seed (int | None) – Random seed for the maze generation, set to None for a random value.

  • args (object) – Arguments to pass to the parent constructor.

  • kwargs (object) – Keyword arguments to pass to the parent constructor.