Skip to content

An ant farm manager! ♻️ In this repo I'll help my little friends find the most optimized path(s) to get form point A to point B by designing and implementing my own pathfinding algorithm 🐜

License

Notifications You must be signed in to change notification settings

psprawka/Lem-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lem-in - the quickest way to get the 🐜🐜🐜 across the farm.

Implemented algorithm analyzes a unique input with a variable number of ants and helps the colony navigate from the start of a maze to the. The solver is multi-pathed, recursive, and weighted for distance, implemented in adjacency list. It doesn't forget about avoiding traffic jams as well as walking all over their fellow ants. A graphical output to watch the ants find their home included! ✅

How to run lem-in?

git clone https://github.com/psprawka/Lem-in.git lem-in-psprawka
cd lem-in-psprawka
make
./lem-in < <map_example>

The exemplary maps are avaliable in maps/ directory. Personally, I'll recommend maps/big/42_france.map.
The output will be displayed in following format:

number_of_ants
the_rooms
the_links
Lx-y Lz-w Lr-o ...

where:

  • x, z, r represent the ants’ numbers (going from 1 to number_of_ants),
  • y, w, o represent the rooms’ names.

A farm rules

There are some rules each given farm has to respect:

  • all ants start in ##start room,
  • lines starting with ## are commands modifying the line that comes right after,
  • ##start signals the ant farm’s entrance and ##end its exit,
  • # means comment till the end of the line,
  • all unknown commands are ignored,
  • non compliant or empty lines will stop the ant farm’s reading,
  • each room can contain only one ant at a time (excluding ##start and ##end).

Create your own farm!

Farm pattern:

number_of_ants
the_rooms
the_links

Remember to include mandatory commands ##start and ##end. If you wish to color a room, add ##<color_name> before a requested room (color_name has to be lowercase).
You can find list of all colors in includes/libft.h file. 🌈🌈🌈

About

An ant farm manager! ♻️ In this repo I'll help my little friends find the most optimized path(s) to get form point A to point B by designing and implementing my own pathfinding algorithm 🐜

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published