Code Monkey home page Code Monkey logo

transformers-aeq's Introduction

The Transformers Simulator

This is a simulator that takes in transformers (autobots and deceptacons) and puts them head to head in battle.

Initialization

You'll need NodeJS to run this program

  1. Download or clone the repo
  2. Run npm install
  3. Run npm test to see the test coverage

To run the program with your own data, use the 'battle' function in index.js See below on how to structure inputs. You can also uncomment the function that runs test data at the bottom of the code

Uncomment this line 104: --> // console.log(battle(testData));

Then run node index.js

Assumptions

  1. The inputs of bots should be and array objects in the following format:
const bots = [
  {
    name: 'Optimus Prime',
    team: 'Autobot',
    skills: {
      strength: 10,
      intelligence: 10,
      speed: 8,
      endurance: 10,
      rank: 10,
      courage: 10,
      firepower: 8,
      skill: 10,
    },
  },
]
  1. The weakest transformers will face the weakest on the other team first.
  2. If the teams are not balanced (eg. 2 vs 4), there will only be as many rounds as the smallest team.
  3. Transformers should have complete and correct data. If not, an error will be returned as a string.
  4. If Optimus Prime or Predaking face eachother, there is no winner and everyone blows up.
  5. The team that eliminates the most of the other team without dying themselves wins.
  6. In the event of a tie, the function returns a tie message.
  7. Everything returned comes back as a string.

Future Improvements

  1. Throw exceptions instead of return for errors
  2. Create some classes rather than using functions
  3. Refactor the battle and pull out the if logic
  4. Improve some of the test coverage.
  5. Build a UI.

Screenshots

Test Coverage Output From Battle

transformers-aeq's People

Contributors

dennyhollick avatar

Watchers

 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.