This Go program simulates an ant farm where ants navigate from a starting room to an ending room. The program reads the configuration from a specified text file, validates the format, constructs a graph of rooms and links, and finds all possible paths for the ants to take.
- Reads input data from a
.txtfile. - Validates the format of the input data.
- Constructs a graph representation of rooms and links.
- Finds all possible paths between the start and end rooms.
- Distributes ants among paths based on their lengths.
- Outputs the movement of ants in a structured format.
The input file must follow this format: [number of ants] ##start [room name] [x-coordinate] [y-coordinate] [room name] [x-coordinate] [y-coordinate] ##end [room name] [x-coordinate] [y-coordinate] [room1]-[room2]
To run the program, use the following command in the terminal:
go run . <fileName.txt>- alahmami
- rserraf
- bbenskou
- ahiti