Git Product home page Git Product logo

roman_to_arabic-2022-07-12's Introduction

Roman to Arabic kata

Learning exercise, writing a code kata to convert roman numerals to arabic numbers. This is simply a reversal of the kata at: https://codingdojo.org/kata/RomanNumerals/

The Romans wrote numbers using letters : I, V, X, L, C, D, M. (notice these letters have lots of straight lines and are hence easy to hack into stone tablets) Part I

The Kata says you should write a function to convert from Roman Numerals to "normal" Arabic numbers: eg

 null --> 0
 I --> 1
 III --> 3
 IV --> 4
 V --> 5
 VI --> 6
 VII --> 7
 VIII --> 8
 IX --> 9
 X --> 10
 XXX --> 30
 XL --> 40
 L --> 50
 C --> 100
 CCC --> 300
 CD --> 400
 D --> 500
 CM --> 900
 M --> 1000
 MCCC --> 1300
 MD --> 1500
 MDCCCXXXII --> 1832
etc.

For a full description of how it works, take a look at this useful reference website.

There is no need to be able to convert numbers larger than 3999. (The Romans themselves didn’t tend to go any higher.)

roman_to_arabic-2022-07-12's People

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.