Coder Social home page Coder Social logo

ph-7 / carrots-rabbits-wolves Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 10.91 MB

๐Ÿ—บ World Simulation Challenge - The world is inhabited by carrots, rabbits, and wolves.

Home Page: https://github.com/pH-7/carrots-rabbits-wolves

License: MIT License

JavaScript 100.00%
carrots coding-challenge rabbits wolves world-simulation problem-solving

carrots-rabbits-wolves's Introduction

๐Ÿฐ 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 ๐Ÿš€

carrots-rabbits-wolves's People

Contributors

ph-7 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.