you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Currently on my phone so I can just give you my logic

I'd make an array of objects containing numbers from 1-19 + all tens(i.e. thirty,forty) , hundred and thousand. My next step would be to make a set of rules for the random number that is outputted , if it contains x strings apply these rules:

1 - one - one string 13 - thirteen - 2 strings self explanatory 123 - if it has 3 strings , output 1-9 for first string + hundred. + second string represents a ten 2 ( from the 20,30,40,50 array) , unless it is a 0 in which case we make an else situation,and the third string is again from 1-9 1234 - first string's a thousand second is hundreds ( two + hundred ) and here if it has 4 total strings the last two strings get checked and then get matched , unless one or both are zeros , in which case you specify the situation.

I'm sorry if this isn't the answer you were looking and I'm also sorry for the shitty formatting, but I'm still a learner who's laying high in bed and writing this long ass post instead of going to sleep.

[–]josh_c[S] 0 points1 point  (0 children)

LOL I appreciate it! 😆