Giter Site home page Giter Site logo

lem-in's Introduction

lem-in

Lem-in is a project made at Hive Helsinki School of 42 network. It involves finding the shortest path through a graph of connected rooms. The project involves implementing a graph data structure, performing graph traversal, and finding the shortest path using an algorithm such as Dijkstra's algorithm.

Usage

To run the lem-in program, simply run the executable with a map file as an argument:

./lem-in < map_file The map file should be formatted as follows:

  • The first line should be the number of ants that need to traverse the graph.

  • The second line should be the starting room.

  • The third line should be the ending room.

  • Each subsequent line should describe a room in the graph, formatted as follows: room_name x y where room_name is the name of the room, and x and y are its coordinates in 2D space.

  • After the list of rooms, there should be a list of connections between rooms, one connection per line. Each connection should be formatted as follows: room_name_1-room_name_2 where room_name_1 and room_name_2 are the names of the two rooms being connected.

Here's an example map file:

5
start
end
room1 1 2
room2 2 2
room3 3 2
start-room1
room1-room2
room2-room3
room3-end

Output

The lem-in program will output the following information:

  • The map file, followed by an empty line.
  • The number of ants that need to traverse the graph, followed by an empty line.
  • The shortest path from the starting room to the ending room, followed by an empty line.
  • The list of ant movements needed to traverse the graph. Each line should contain the ant's ID and the name of the room it's moving to, separated by a dash. For example:
L1-room1
L2-room1
L1-end

This indicates that ant 1 moves to room1, ant 2 also moves to room1, and then ant 1 moves to the end room.

License

The lem-in project is licensed under the MIT License. See the LICENSE file for details.

lem-in's People

Contributors

pavel-arkharov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.