I hereby claim:
- I am ddevlin on github.
- I am ddevlin (https://keybase.io/ddevlin) on keybase.
- I have a public key ASDY0vVRlJmViv2so1OREkvjZjdF9qTZ6Phyk02o37gODwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
defmodule Katas do | |
def numeral_to_int(numeral, numbers \\ []) do | |
case numeral do | |
"CM" <> rest -> numeral_to_int(rest, numbers ++ [900]) | |
"CD" <> rest -> numeral_to_int(rest, numbers ++ [400]) | |
"XC" <> rest -> numeral_to_int(rest, numbers ++ [90]) | |
"XL" <> rest -> numeral_to_int(rest, numbers ++ [40]) | |
"IX" <> rest -> numeral_to_int(rest, numbers ++ [9]) | |
"IV" <> rest -> numeral_to_int(rest, numbers ++ [4]) |