Maze Solver_RWA2_GROUP21
This project is used to solve the maze using wall follower algorithm
test_mazes Namespace Reference

Functions

def parametrize_maze_files (maze_files)
 
def read_maze (maze_file)
 
def find_tagged_cells (rows, tag)
 
def test_file_name (maze_file)
 
def test_classic_size (maze_file)
 
def test_training_size (maze_file)
 
def test_format (maze_file)
 
def test_boundaries (maze_file)
 
def test_starting_cell_unique (maze_file)
 
def test_starting_cell (maze_file)
 
def test_goal_cells (maze_file)
 
def test_classic_goal_cells (maze_file)
 

Variables

int CLASSIC_SIZE = 16
 
int HALFSIZE_SIZE = 32
 
 classic_mazes = list(Path('classic').glob('*'))
 
 halfsize_mazes = list(Path('halfsize').glob('*'))
 
 training_mazes = list(Path('training').glob('*'))
 
 competition_mazes = classic_mazes + halfsize_mazes
 
 all_mazes = classic_mazes + halfsize_mazes + training_mazes
 

Detailed Description

Basic tests to ensure maze files are properly formatted.

Function Documentation

◆ find_tagged_cells()

def test_mazes.find_tagged_cells (   rows,
  tag 
)
Find the set of cell positions that have a given tag.
Here is the caller graph for this function:

◆ test_boundaries()

def test_mazes.test_boundaries (   maze_file)
Maze boundaries are expected to be closed.

◆ test_classic_goal_cells()

def test_mazes.test_classic_goal_cells (   maze_file)
Classic goal cells are always in the middle of the maze.
Here is the call graph for this function:

◆ test_classic_size()

def test_mazes.test_classic_size (   maze_file)
Classic maze size is always 16x16.

◆ test_file_name()

def test_mazes.test_file_name (   maze_file)
- All maze files must be text files with `.txt` extension.
- Only "a-z", "0-9" and "-" characters are allowed.

◆ test_format()

def test_mazes.test_format (   maze_file)
Maze file format must be homogeneous. Vertical walls are represented with
a `|`, horizontal walls with `---` and posts with `o`.

Even rows must:

- Have a post each 4 characters.
- Have a wall `---` or nothing `   ` between posts.

Odd rows must:

- Have a wall `|` or nothing ` ` each 4 characters.

◆ test_goal_cells()

def test_mazes.test_goal_cells (   maze_file)
Goal cells must be marked with a "G" and form a rectangular area.
Here is the call graph for this function:

◆ test_starting_cell()

def test_mazes.test_starting_cell (   maze_file)
The starting cell is expected to be at the South-West and facing North.

◆ test_starting_cell_unique()

def test_mazes.test_starting_cell_unique (   maze_file)
The starting cell, if marked, must be unique.

◆ test_training_size()

def test_mazes.test_training_size (   maze_file)
Training maze size is the same as classic size, even if not fully used.