CodeGolf Challenge
PWSSHHHH! You wake up in a cryogenics lab in the year 3000. Upon being escorted to the assignment office to receive your career chip, presumably that of a delivery boy, a probe detects that you are from the year 2000. Because of this, and a few stereotypes, you are assumed stupid compared to today's modern human and are forced to repeat gradeschool.
You enter your first grade classroom and the teacher is giving an assignment. She will say or write a number up to 50. If she writes the number on the board (for example: 25) then you have to say the numbers up to that number "one, two, three, ..., twenty-five". If she says the number out loud (for example: "six") then, on your tablet, you have to write the numbers up to that number "1, 2, 3, 4, 5, 6"
This becomes very tedious and you decide you will automate the process with your still functioning, yet archaic, 21st century programming knowledge.
Objective:
Your program should take an input. This input will either be a decimal number (1 thru 50
) or a written-out number (one thru fifty
).
•If the input is a decimal number, your output should count from one to said number, using written-out style. (e.g. thirty-two)
•If the input is a written-out number, your output should count from 1 to said number, using decimal style. (e.g. 32)
Rules:
Input and Output can be in any case of your choosing (so you can make a program that only accepts upper-case if desired).
Input decimal numbers do not have to be of a number type (e.g. int), they can be a input string containing numbers (25 vs "25"). Either are fine and you can chose which one you want your program to accept. (Your program does not need to accept both)
Written out style does NOT require a hyphen between compound words, but you can if desired.
Output values have to be separated in some form, any separator is fine 1,2,3
1 2 3
etc
You can not add extra libraries like num2words (python) etc (However system libraries are fine)
Even though the back-story says you are from the year 2000, you can use languages created after that date (lol)
This is code-golf, so the program with the shortest bytecount wins!