Sha256: 17a2601fa12bfb39ffa94cf55e9ba7a2599c418eb557f87dceaabdd8b717c144

Contents?: true

Size: 1.32 KB

Versions: 174

Compression:

Stored size: 1.32 KB

Contents

## Step 1

Handle the basic case of 0 through 99.

If the input to the program is `22`, then the output should be
`'twenty-two'`.

Your program should complain loudly if given a number outside the
blessed range.

Some good test cases for this program are:

- 0
- 14
- 50
- 98
- -1
- 100

### Extension

If you're on a Mac, shell out to Mac OS X's `say` program to talk out
loud.

## Step 2

Implement breaking a number up into chunks of thousands.

So `1234567890` should yield a list like 1, 234, 567, and 890, while the
far simpler `1000` should yield just 1 and 0.

The program must also report any values that are out of range.

## Step 3

Now handle inserting the appropriate scale word between those chunks.

So `1234567890` should yield `'1 billion 234 million 567 thousand 890'`

The program must also report any values that are out of range.  It's
fine to stop at "trillion".

## Step 4

Put it all together to get nothing but plain English.

`12345` should give `twelve thousand three hundred forty-five`.

The program must also report any values that are out of range.

### Extensions

Use _and_ (correctly) when spelling out the number in English:

- 14 becomes "fourteen".
- 100 becomes "one hundred".
- 120 becomes "one hundred and twenty".
- 1002 becomes "one thousand and two".
- 1323 becomes "one thousand three hundred and twenty-three".

Version data entries

174 entries across 174 versions & 1 rubygems

Version Path
trackler-2.1.0.18 common/exercises/say/description.md
trackler-2.1.0.17 common/exercises/say/description.md
trackler-2.1.0.16 common/exercises/say/description.md
trackler-2.1.0.15 common/exercises/say/description.md
trackler-2.1.0.14 common/exercises/say/description.md
trackler-2.1.0.13 common/exercises/say/description.md
trackler-2.1.0.12 common/exercises/say/description.md
trackler-2.1.0.11 common/exercises/say/description.md
trackler-2.1.0.10 common/exercises/say/description.md
trackler-2.1.0.9 common/exercises/say/description.md
trackler-2.1.0.8 common/exercises/say/description.md
trackler-2.1.0.7 common/exercises/say/description.md
trackler-2.1.0.6 common/exercises/say/description.md
trackler-2.1.0.5 common/exercises/say/description.md
trackler-2.1.0.4 common/exercises/say/description.md
trackler-2.1.0.3 common/exercises/say/description.md
trackler-2.1.0.2 common/exercises/say/description.md
trackler-2.1.0.1 common/exercises/say/description.md
trackler-2.1.0.0 common/exercises/say/description.md
trackler-2.0.8.55 common/exercises/say/description.md