1
\$\begingroup\$

Here's a simple one.

In the shortest code possible, given an arbitrary number such as 567421, print it out in words:

five
six
seven
four
two
one

You may assume the input is an integer that is already provided in a one-letter variable such as n.

\$\endgroup\$

marked as duplicate by ProgramFOX, undergroundmonorail, Martin Ender, user80551, Ventero Jun 27 '14 at 13:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ I see, sorry about that, didn't find those when i was searching. \$\endgroup\$ – ToonAlfrink Jun 27 '14 at 12:52
  • \$\begingroup\$ Though both possible duplicates ask something slightly different. \$\endgroup\$ – ToonAlfrink Jun 27 '14 at 12:52
  • \$\begingroup\$ In particular the only change you need to make to answers of the duplicate mentioned by undergroundmonorail is to call the code you already have for each digit of the input. \$\endgroup\$ – Martin Ender Jun 27 '14 at 12:56
2
\$\begingroup\$

Python

for i in `n`:print' ottffssennwhoiieiieoruvxvgn  ere ehe  e   nt'[int(i)::9]

"Inspired" by https://codegolf.stackexchange.com/a/32156/18638

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.