Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

🗺 World Simulation Challenge (inspired by Francesco Cesarini's Erlang programming concepts). The world is inhabited by carrots that grow from the earth, rabbits that feed on carrots, and wolves that hunt rabbits in an intricate food chain.

License

Notifications You must be signed in to change notification settings

pH-7/carrots-rabbits-wolves

Open more actions menu

Repository files navigation

🐰 The Rabbits, Wolves, and Carrots' World 🐺

The world is inhabited by carrots, rabbits, and wolves! 🌎

World Problem

Rabbits would roam this world eating car- rots that grew in random patches. When they had eaten enough carrots, the rabbits would get fat and split in two. Wolves ran around eating up the rabbits; if they managed to catch and eat enough rabbits, they would also get fat and split. Rabbits and wolves within a certain distance of each other would broadcast information on food and predators. If a rabbit found a carrot patch, other rabbits would quickly join him. If a wolf found a rabbit, the pack would start chasing it.

Specification / Requirement

  • You will need to install NodeJS (v14 or newer) and npm on your machine for testing it (if it isn't the case).

How to run the project

  • At the location to which the project has been unzipped,
    • Run npm install to install the dependencies.
    • Then, run node src/cli.js (or just npm start).
    • See the results shown in the command line.
    • See the results in results.txt

Running unit tests

npm run test

Or with npx

npx ava

Simulation Results

Available in both results.txt and world-simulation-results.png files.

Early Simulation Graphic Results

Later Simulation Graphic Results

Happy Hunting! 🥕🐇🐺

License

Distributed under MIT license 🚀

About

🗺 World Simulation Challenge (inspired by Francesco Cesarini's Erlang programming concepts). The world is inhabited by carrots that grow from the earth, rabbits that feed on carrots, and wolves that hunt rabbits in an intricate food chain.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.