+ 4

🔢Challenge: Count by digits or words (fka Wake up from Cryo-Freeze) 🔢

https://codegolf.stackexchange.com/questions/108757/automate-your-first-grade-counting-exercise Challenge required 2 posts for background, objective and rules. 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 modern human and are forced to repeat gradeschool. (Cont)

26th Feb 2018, 5:58 AM
SQrL
SQrL - avatar
8 ответов
+ 2
My try, using functions introduced in C++ in 2003 and 2011. https://code.sololearn.com/cut7fy4W0vlz/?ref=app
26th Feb 2018, 7:26 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 3
(Cont) 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 BORROWED FROM CODE GOLF, BUT WE ARE NOT USING CODE GOLF RULES.
26th Feb 2018, 6:02 AM
SQrL
SQrL - avatar
+ 3
I don’t know how. Probably should login with a PC instead of my phone 😏
26th Feb 2018, 7:39 AM
SQrL
SQrL - avatar
+ 3
I’m not seeing that in my iOS app. Or in browsers pointed at SoloLearn.com. I’ll try later.
26th Feb 2018, 8:00 AM
SQrL
SQrL - avatar
+ 3
Just got that today. Great enhancement, but no lesson creation from what I can tell. Time to switch to my lesser-used droid device 😉
26th Feb 2018, 8:06 AM
SQrL
SQrL - avatar
+ 2
@SQrL Have you posted this as an assignment in lesson factory? If not, please do...
26th Feb 2018, 7:37 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 2
@SQrL You can post it via your phone. At the home page, select 'Lesson Factory', under the Menu. Then just select type as assignment and post your challenge there.
26th Feb 2018, 7:43 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
@SQrL Have you installed the latest update, btw? https://www.sololearn.com/discuss/1093920/?ref=app
26th Feb 2018, 8:01 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar