https://github.com/ph-7/carrots-rabbits-wolves
🗺 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.
https://github.com/ph-7/carrots-rabbits-wolves
carrots carrots-rabbits carrots-rabbits-wolves coding-challenge javascript-coding-challenges javascript-game problem-solving problem-solving-algorithms problem-solving-exercise rabbits rabbits-wolves wolf wolves world-simulation world-simulation-puzzle
Last synced: 6 months ago
JSON representation
🗺 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.
- Host: GitHub
- URL: https://github.com/ph-7/carrots-rabbits-wolves
- Owner: pH-7
- License: mit
- Created: 2022-05-24T11:04:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T08:48:54.000Z (over 1 year ago)
- Last Synced: 2025-05-14T09:14:30.647Z (6 months ago)
- Topics: carrots, carrots-rabbits, carrots-rabbits-wolves, coding-challenge, javascript-coding-challenges, javascript-game, problem-solving, problem-solving-algorithms, problem-solving-exercise, rabbits, rabbits-wolves, wolf, wolves, world-simulation, world-simulation-puzzle
- Language: JavaScript
- Homepage: https://github.com/pH-7/carrots-rabbits-wolves
- Size: 10.7 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🐰 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).
- If needed, download them both here: https://nodejs.org/en/download
## 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
```console
npm run test
```
Or with `npx`
```console
npx ava
```
## Simulation Results
Available in both `results.txt` and `world-simulation-results.png` files.


Happy Hunting! 🥕🐇🐺
## License
Distributed under _[MIT](https://opensource.org/licenses/MIT)_ license 🚀