Skip to content

Latest commit

History

History
50 lines (28 loc) 路 1.57 KB

README.md

File metadata and controls

50 lines (28 loc) 路 1.57 KB

馃惏 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 馃殌