The world is inhabited by carrots, rabbits, and wolves! 🌎
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.
- 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
- At the location to which the project has been unzipped,
- Run
npm install
to install the dependencies. - Then, run
node src/cli.js
(or justnpm start
). - See the results shown in the command line.
- See the results in
results.txt
- Run
npm run test
Or with npx
npx ava
Available in both results.txt
and world-simulation-results.png
files.
Happy Hunting! 🥕🐇🐺
Distributed under MIT license 🚀