Maze Solver_RWA2_GROUP21
This project is used to solve the maze using wall follower algorithm
simulator.h
Go to the documentation of this file.
1 #ifndef __SIMULATOR_H__
2 #define __SIMULATOR_H__
3 
14 #pragma once
15 
16 #include <string>
17 
18 
19 class Simulator {
20  public:
26  static int mazeWidth();
32  static int mazeHeight();
33 
40  static bool wallFront();
47  static bool wallRight();
54  static bool wallLeft();
60  static void moveForward(int distance = 1);
65  static void turnRight();
70  static void turnLeft();
78  static void setWall(int x, int y, char direction);
87  static void clearWall(int x, int y, char direction);
98  static void setColor(int x, int y, char color);
105  static void clearColor(int x, int y);
109  static void clearAllColor();
110 
118  static void setText(int x, int y, const std::string& text);
125  static void clearText(int x, int y);
130  static void clearAllText();
137  static bool wasReset();
141  static void ackReset();
142 };
143 
144 #endif
Simulator::setText
static void setText(int x, int y, const std::string &text)
Set the text in a cell at the given coordinates.
Definition: simulator.cpp:88
Simulator::clearWall
static void clearWall(int x, int y, char direction)
Remove a wall at the given coordinates.
Definition: simulator.cpp:72
Simulator::turnLeft
static void turnLeft()
Turn the robot left.
Definition: simulator.cpp:62
Simulator::setWall
static void setWall(int x, int y, char direction)
Set a wall at the given coordinates.
Definition: simulator.cpp:68
Simulator::ackReset
static void ackReset()
Moves the robot back to the starting position.
Definition: simulator.cpp:107
Simulator::wasReset
static bool wasReset()
Check wether or not the reset button has been pressed.
Definition: simulator.cpp:100
Simulator::wallFront
static bool wallFront()
Check if there is a wall in front of the robot.
Definition: simulator.cpp:19
Simulator::moveForward
static void moveForward(int distance=1)
Move the robot forward.
Definition: simulator.cpp:40
Simulator::clearColor
static void clearColor(int x, int y)
Clear the color of the cell at the given coordinates.
Definition: simulator.cpp:80
Simulator
Definition: simulator.h:19
Simulator::mazeHeight
static int mazeHeight()
Compute the height of the maze.
Definition: simulator.cpp:12
Simulator::clearAllColor
static void clearAllColor()
Clear the color of all cells in the maze.
Definition: simulator.cpp:84
Simulator::turnRight
static void turnRight()
Turn the robot right.
Definition: simulator.cpp:56
Simulator::clearAllText
static void clearAllText()
Clear the text in all cells of the maze.
Definition: simulator.cpp:96
simulator.h
Functions to control the robot and get information on the maze.
Simulator::mazeWidth
static int mazeWidth()
Compute the width of the maze.
Definition: simulator.cpp:5
Simulator::wallRight
static bool wallRight()
Check if there is a wall to the right of the robot.
Definition: simulator.cpp:26
Simulator::wallLeft
static bool wallLeft()
Check if there is a wall to the left of the robot.
Definition: simulator.cpp:33
Simulator::clearText
static void clearText(int x, int y)
Clear the text in a cell at the given coordinates.
Definition: simulator.cpp:92
Simulator::setColor
static void setColor(int x, int y, char color)
Set the color of the cell at the given coordinates.
Definition: simulator.cpp:76