MiniScript Journeyman

Number-to-Words function

Only editable by group admins

  • Last updated November 24, 2019 at 12:44 PM by jstrout
  • Evidence only visible to badge awarders
Write a MiniScript program that converts a number to words (reading out each digit). Submit your program code.
Write a program that defines a map from numbers 0-9 to words (0 to "zero", 1 to "one", etc.) 

Add a function that takes any number, and converts it to words just by converting each digit in order.  For example, given 123, this function should return "one two three".  

Finally, print out the result of calling this function on several values: 0, 42, and 123.