Coder Social home page Coder Social logo

roman_js's Introduction

Romanize!

Objective

Create a function that accepts an integer as an argument. It should then convert that number into its roman numeral equivalent.

2499 = MMCDXCIX
543 = DXLIII
13 = XIII

Specs? (aka What's this SpecRunner.html?)

If you open SpecRunner.html in your browser, you can see that there are 19 specifications, 8 pass and 11 fail. These specifications (or tests) indicate how your code should perform. They provide examples of what output is expected for various inputs. Eight specs already pass, because the starter code supports them.

Check out src/Roman.js. You can see that the specs are expecting a function called "romanize", that accepts an Arabic numeral and returns a Roman numeral.

Click on "Spec List" in the browser (SpecRunner.html) to see a listing of the specs. See that the numbers below 10 are passing (green)? The specs live in spec/RomanSpec.js.

You may find SpecRunner.html helpful as you refactor your code to support the next range of Roman Numerals.

Pro-Tip: Comment out the failing specs, leaving only a single failing spec. Just focus on one requirement at a time.

Pro-Tip: Beware of infinite recursion and infinite loops. If your SpecRunner.html takes a very long time to load or shows the Chrome Kill/Wait dialog, you probably have something infinite in your code.

Pairing!

Let's do a quick fist-to-five. Pair with someone who is within one number of you. Ideally, pair with someone you've never worked with before!

Pseudo Code!

We recommend you pseudocode for a few minutes. Start writing down/typing how to break this problem down.

Stating the obvious

You are looking for an algorithm that will calculate a Roman numeral. Simply creating a massive conversion chart that includes all numbers is, well, simply painful.

Bonus

  • How clear is your code? Is it obvious where you support the subtraction cases (IV, IX, etc)? Does your code reflect your vision of how you, personally, calculate Roman Numerals?
  • Create a web page that converts roman numerals

roman_js's People

Contributors

amaseda avatar robertakarobin avatar zebgirouard 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.