Maze Solver_RWA2_GROUP21
This project is used to solve the maze using wall follower algorithm
Simulator Class Reference

Static Public Member Functions

static int mazeWidth ()
 Compute the width of the maze. More...
 
static int mazeHeight ()
 Compute the height of the maze. More...
 
static bool wallFront ()
 Check if there is a wall in front of the robot. More...
 
static bool wallRight ()
 Check if there is a wall to the right of the robot. More...
 
static bool wallLeft ()
 Check if there is a wall to the left of the robot. More...
 
static void moveForward (int distance=1)
 Move the robot forward. More...
 
static void turnRight ()
 Turn the robot right. More...
 
static void turnLeft ()
 Turn the robot left. More...
 
static void setWall (int x, int y, char direction)
 Set a wall at the given coordinates. More...
 
static void clearWall (int x, int y, char direction)
 Remove a wall at the given coordinates. More...
 
static void setColor (int x, int y, char color)
 Set the color of the cell at the given coordinates. More...
 
static void clearColor (int x, int y)
 Clear the color of the cell at the given coordinates. More...
 
static void clearAllColor ()
 Clear the color of all cells in the maze.
 
static void setText (int x, int y, const std::string &text)
 Set the text in a cell at the given coordinates. More...
 
static void clearText (int x, int y)
 Clear the text in a cell at the given coordinates. More...
 
static void clearAllText ()
 Clear the text in all cells of the maze. More...
 
static bool wasReset ()
 Check wether or not the reset button has been pressed. More...
 
static void ackReset ()
 Moves the robot back to the starting position.
 

Member Function Documentation

◆ clearAllText()

void Simulator::clearAllText ( )
static

Clear the text in all cells of the maze.

Here is the caller graph for this function:

◆ clearColor()

void Simulator::clearColor ( int  x,
int  y 
)
static

Clear the color of the cell at the given coordinates.

Returns
int X coordinate of the cell.
int Y coordinate of the cell.

◆ clearText()

void Simulator::clearText ( int  x,
int  y 
)
static

Clear the text in a cell at the given coordinates.

Parameters
xX coordinate of the cell.
yY coordinate of the cell.

◆ clearWall()

void Simulator::clearWall ( int  x,
int  y,
char  direction 
)
static

Remove a wall at the given coordinates.

Parameters
xX coordinate of the cell.
yY coordinate of the cell.
directiondirection Direction of the wall. Can be 'n', 's', 'e', 'w'.

◆ mazeHeight()

int Simulator::mazeHeight ( )
static

Compute the height of the maze.

Returns
int Height of the maze.

◆ mazeWidth()

int Simulator::mazeWidth ( )
static

Compute the width of the maze.

Returns
int Width of the maze.

◆ moveForward()

void Simulator::moveForward ( int  distance = 1)
static

Move the robot forward.

Parameters
distanceDistance (number of cell) to move forward.
Here is the caller graph for this function:

◆ setColor()

void Simulator::setColor ( int  x,
int  y,
char  color 
)
static

Set the color of the cell at the given coordinates.

Parameters
xX coordinate of the cell.
yY coordinate of the cell.
colorColor of the cell. Can be 'k' (black), 'b' (blue), 'a' (Gray), 'c' (cyan), 'g' (green), 'o' (orange), 'r' (red), 'w' (white), 'y' (yellow) 'B' (dark blue), 'C' (dark cyan), 'A' (dark gray), 'G' (dark green), 'R' (dark green), 'Y' (dark yellow).
Here is the caller graph for this function:

◆ setText()

void Simulator::setText ( int  x,
int  y,
const std::string &  text 
)
static

Set the text in a cell at the given coordinates.

Parameters
xX coordinate of the cell.
yY coordinate of the cell.
textText to display in the cell.
Here is the caller graph for this function:

◆ setWall()

void Simulator::setWall ( int  x,
int  y,
char  direction 
)
static

Set a wall at the given coordinates.

Parameters
xX coordinate of the cell.
yY coordinate of the cell.
directionDirection of the wall. Can be 'n', 's', 'e', 'w'.
Here is the caller graph for this function:

◆ turnLeft()

void Simulator::turnLeft ( )
static

Turn the robot left.

Here is the caller graph for this function:

◆ turnRight()

void Simulator::turnRight ( )
static

Turn the robot right.

Here is the caller graph for this function:

◆ wallFront()

bool Simulator::wallFront ( )
static

Check if there is a wall in front of the robot.

Returns
true
false
Here is the caller graph for this function:

◆ wallLeft()

bool Simulator::wallLeft ( )
static

Check if there is a wall to the left of the robot.

Returns
true
false
Here is the caller graph for this function:

◆ wallRight()

bool Simulator::wallRight ( )
static

Check if there is a wall to the right of the robot.

Returns
true
false
Here is the caller graph for this function:

◆ wasReset()

bool Simulator::wasReset ( )
static

Check wether or not the reset button has been pressed.

Returns
true
false

The documentation for this class was generated from the following files: