Code Monkey home page Code Monkey logo

mythical_critters's Introduction

Mythical Critters

Each exercise emphasizes the fundamentals of object oriented programming in JavaScript.

Installation Steps

  1. While in the root of this repository, run npm install in your terminal
  2. Test that the unit tests are working: Run the command npm test test/unicorn-test.js in your terminal

You should see something like:

> [email protected] test /Users/robbie/turing/front-end/1mod/mythical-critters
> mocha "test/unicorn-test.js"

  Unicorn
    - should be a function
    - should instantiate our good friend, Unicorn
    - should have a name
    - should have a color
    - should be white as default
    - should refute isWhite
    - should say sparklying stuff


  0 passing (6ms)
  7 pending

Running the Tests

Most of the tests are skipped. When you see it.skip('should be a function', () => { in a test, it means that test has been skipped. They are skipped for a good reason - that way, when you run the test suite for the first time, you don't see tons of errors screaming at you in the terminal.

Un-skip each test, one at a time in order, so you can concentrate on making one test pass. Un-skip the test by deleting the .skip from the test's first line so it should look more like it('should be a function', () => {. Run the test to see what kind of error you are getting, and then implement the code to make the test pass!

Video Tutorial!

Here is a video that walks through the setup and first mythical creature. (Note: some names of directories/files may differ slightly from this repo).

Critters to Complete for Pre-Work

These are the critters we are asking you to complete for pre-work. Unicorn will help you get started and is very simple compared to the others.

  • unicorn
  • medusa
  • werewolf
  • centaur
  • direwolf
  • fairy
  • ogre
  • sphinx

Extra Critters

If you've done the critters above and feel comfortable with those, try conquering a few more critters!

  • vampire
  • dragon
  • hobbit
  • pirate
  • wizard

Extra Challenges

The if Statement

Can you complete implementations of each of the critters without using if statements? Think about how removing them affects your code. (Note: using a ternary instead is not sufficient here; under the hood it's the same thing.)

Imagine Two Critters

Can you add two new critters to the repository? How about a Hydra? Add unit tests exercising some of the following concepts:

  • Initializing constructor with data
  • Using methods to change the internal state of an instance
  • Using methods to query the internal state of an instance

mythical_critters's People

Contributors

dionew1 avatar joshsherwood1 avatar

Watchers

James Cloos 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.