Git Product home page Git Product logo

morning-exercises's Introduction

Morning-Exercises for Atl WDI-10

These are a collection of random logic problems I found online and wrote tests for so you can see whether or not you got the answer correct. Like everything else in coding, there are a million different ways to solve a problem and no particularly correct answer. Having said that, you should strive to write DRY and readable code. I've ranked these according to difficulty, nothing crazy. Have fun.

** ¯\(ツ)/¯ **

Instructions:

Clone this repo into whatever folder you like (preferably outside of your atl-wdi-10 folder to avoid endless git conflicts).

Mocha

Mocha and chai are test suites that I used so that you might check your answers.

Installation:

To install mocha, run this from anywhere in your terminal:

npm install -g mocha

Now that you've installed mocha globally, you can run tests from the command line.

In the root folder of your cloned repo run (just in case this gets more complex down the line).

npm install

Running Tests:

You'll notice that each problem (exercise?) is in it's own folder. If we're doing 'sortaSum', cd into that folder. Each prompt and instructions will be in the js file with the name of the problem (don't go into the test folder, unless you really want to).

The prompt will include the general instructions, a few examples, and maybe a hint, who knows? It's important that you don't change the name of the function where you'll write your answer. It will mess with the tests if you do. The tests themselves are pretty general but should cover all the edge/use cases I could think of.

To run a test for a particular problem, make sure you're in that problem's specific folder, then in terminal run:

mocha test

That's it.

For example, if I'm in sortaSum and I think have a working answer, my output should look something like this:

$ mocha test


  sortaSum
    #actual sum less than 10
      1) should return 7 with arguments 3 and 4
      2) should return 9 with arguments 12 and -3
      3) should return 9 with arguments -3 and 12
    #actual sum more than 19
      4) should return 21 with arguents 10 and 11
      5) should return 21 with arguments 14 and 7
      6) should return 20 with arguments 14 and 6
    #actual sum in **forbidden zone**
      7) should return 20 with arguments 9 and 4
      8) should return 20 with arguments 4 and 6


  0 passing (9ms)
  8 failing

morning-exercises's People

Contributors

fhappy avatar

Watchers

James Cloos avatar  avatar

Forkers

pranavchebolu

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.