Short and sweet description of the challenge:
Based off the ideas of several other questions on this site, your challenge is to write the most creative code in any program that takes as input a number written out in English and converts it to integer form.
Really dry, long and thorough specifications:
- Your program will receive as input an integer in lowercase English between
zero
andnine hundred ninety-nine thousand nine hundred ninety-nine
inclusive. - It must output only the integer form of the number between
0
and999999
and nothing else (no whitespace). - The input will NOT contain
,
orand
, as inone thousand, two hundred
orfive hundred and thirty-two
. - When the tens and ones places are both nonzero and the tens place is greater than
1
, they will be separated by a HYPHEN-MINUS character-
instead of a space. Ditto for the ten thousands and thousands places. For example,six hundred fifty-four thousand three hundred twenty-one
. - The program may have undefined behavior for any other input.
Some examples of a well-behaved program:
zero
-> 0
fifteen
-> 15
ninety
-> 90
seven hundred four
-> 704
sixty-nine thousand four hundred eleven
-> 69411
five hundred twenty thousand two
-> 520002