A-maze-D documentation 1.0.0
Loading...
Searching...
No Matches
robots.c File Reference

The robots.c. More...

Functions

robot_tcreate_robots_list (room_t *start, int nb_robots)
 Create a list of robots.
 
void remove_robots_at_end (room_t *end, robot_t **robots)
 Remove the robots at the end of the maze.
 
robot_path_tcreate_robot_path (room_t *rooms_list, robot_t *robot, room_t *end)
 
room_tget_next_robot_room (room_t *rooms_list, robot_t *robot, room_t *end)
 Get the next room of the robot.
 
void move_robots (maze_t *maze)
 Move the robots.
 

Detailed Description

The robots.c.

Author
Nicolas TORO

Function Documentation

◆ create_robots_list()

robot_t * create_robots_list ( room_t * start,
int nb_robots )

Create a list of robots.

Parameters
startThe room where the robots start
nb_robotsThe number of robots
Returns
robot_t * The list of robots
Author
Nicolas TORO

◆ get_next_robot_room()

room_t * get_next_robot_room ( room_t * rooms_list,
robot_t * robot,
room_t * end )

Get the next room of the robot.

Note
en gros, on a deux chemin possible. Soit on cherche le meilleure chemin en esquivant les room pleine, soit on cherche le chemin le plus court en passant par les room pleine et en comptant le nombre de tour qu'on va attendre dans la dernière room
Parameters
rooms_listThe list of rooms
robotThe robot
endThe end room
Returns
room_t * The next room of the robot
Author
Nicolas TORO

◆ move_robots()

void move_robots ( maze_t * maze)

Move the robots.

Parameters
mazeThe maze
Returns
void
Author
Nicolas TORO

◆ remove_robots_at_end()

void remove_robots_at_end ( room_t * end,
robot_t ** robots )

Remove the robots at the end of the maze.

Parameters
endThe end room
robotsThe list of robots
Returns
void
Author
Nicolas TORO