Giter VIP home page Giter VIP logo

scrambled-number-generator's Introduction

#Scrambled Number Generator

  • Plan your execution on white board before forking and cloning.
  • Fork and clone the project.
  • Set up your file structure.
    • [Folder] Scrambled-Number-Generator
      • [Folder] js
        • generator.js
      • [Folder] spec
        • generator-spec.js
  • Install npm, mocha, and chai from your Scrambled-Number-Generator folder
 $ npm init
 $ npm install -D mocha chai
  • Write unit tests for the generator in generator-spec.js. Commit!
    • Include either or both declations in your spec.js, depending on what syntax you want to use:
      var should = chai.should();
      var expect = chai.expect;
    • Also include
    var chai = require("chai");
    var generator = require("../js/generator.js");
    • Be logical and atomic in your unit tests.
  • Run your tests by running mocha.
mocha ./spec
  • Implement the generator in generator.js. Commit!
    • Function name : generate
    • Takes "amount", the amount of numbers to generate, counting from 0 to "amount" - 1
    • Returns an array containing the specified number of UNIQUE numbers.
    • Calling the function with the same parameter subsequent times will return the array of numbers in a new, random order.
      • For example, calling
      $ generate(1000)
      should return an array that contains 1000 unique numbers.
      • Calling it again should return the same numbers in random order.
      • Include
      module.exports = generate;

scrambled-number-generator's People

Contributors

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