Git Product home page Git Product logo

cretesuite-backend's Introduction

Home assessment

This is a take home assessment for the interviews.

Overview

This example is based on the Cones of Dunshire, a fictional game from the tv show Parks Recreation.

In this game, a character contains both health and strength. Each time they take a turn, they lose 1 health and 1 strength. Simple enough.

Of course, it's not that simple.

  1. health and strength can't drop below 0 and strength can't increase above 20.
  2. some characters have special behaviors:

Ledgerman

The Ledgerman is just the score keeper and never gains or loses health and strength.

Maverick

The Maverick is the offensive role and has these unique traits:

  1. can gain a maximum of 40 strength
  2. gains 2 strength if health is 5 or less
  3. gains 1 strength if health is between 6 and 10

Alchemist

The Alchemist is very bespoke:

  1. if strength is less than 10, they gain 1 strength
  2. if the Alchemist ends the turn with 5 health or less, they lose all their strength
  3. the Alchemist has an additional property, vilesAvailable, which is equal to 1/2 their end of turn strength (rounded up).

Instructions

Since we all have many other priorities in life, please timebox this assignment to no more than a few hours.

Your objective is to add a new character, the "Farmer".

The Farmer of course has special behaviors:

  1. loses 2 health each turn
  2. loses 1 strength each turn
  3. loses an additional strength if health is at or below 5
  4. when health reaches 0, strength gets set to 20. Why? Because "it's about the cones"

These test cases have already been written for you on lines 394-496. Please remove the skip on lines 394 and make them green!

Of course, refactoring cones-of-dunshire.ts is suggested. We are fans of both object oriented and functional styles of programming, take your pick!

Once completed, please create a private GitHub repo and invite brandonwestcott as a contributor.

Getting started

Install dependencies

yarn install

Running the test suite

yarn run test

cretesuite-backend's People

Contributors

fzzio avatar hatchy-reviewer avatar

Watchers

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