ackvonhuelioLvl 41
happy birthday @[WUT] Adam
happy birthday @[WUT] Adam
Ravage does this have to include the whole JS "Integer" range of 252? what are we capping this at?
and happy birthday @[WUT] Adam
Varrience Ah, sorry - capping at "nine hundred ninety-nine billion nine hundred ninety-nine thousand nine hundred ninety-nine," or 999,999,999,999.
Also, looks like @[WUT] Adam came back on the forum for his birthday lol
what-the-dog-doin (partially works, works with the max number)
what-the-dog-doin A. It doesn't work
B. number to English, not English to number lol
And it has to go in the console.
Ravage I think you meant nine hundred ninety-nine billion nine hundred ninety-nine million nine hundred ninety-nine thousand nine hundred and ninety-nine
Also happy late birthday @[WUT] Adam
Yo happy birthday adam
just under 500 characters but you might be able to optimize it further https://studio.code.org/projects/applab/Olq0A0eAWQvHyKWo0cDjyeXzsrnCs019z4atnym_-70/view
458 chars
Ravage well mine took a little time and it's super ugly haven't counted yet this challenge is an astronomical leap from the previous challenges considering this requires parsing knowledge while keeping the process as small as possible
Additionally does this also have to count 0 within the given range? @Letti42's current solution produces no output when fed 0 or "zero" oversights like these make it harder to present a given solution
not only that but feeding certain inputs produces the incorrect padding used with the pattern for instance 6000443
produces "thousand" when there is no presence of thousands within the number now you understand the troubleshooting hell I've been through is just the tip of the iceburg
Also are we allowed to have rough formatting AKA extra spaces or the "hundred and six" in our answers? or does that also need to be corrected?
If were being lenient on what i asked for i can reveal my answer was piling up a list to this point so it wouldn't be a bunch of ping pong
ok well its updated now @ 478 characters
Varrience Bruh, of course that's what we're using... You need "and" when there is no 10s between the 1s and a greater base, for example, 1009 or 305. If there is a tens, then it uses the hyphen: 126 is one hundred twenty-six.
And hey there's a featured project! Not particularly interesting, though. Someone, make it all into one line and repost it as "3D animation 1 line of code"
Ravage was asking cuz letti didn't have it in his anywho here's mine
// minified 455 version: all
function a(e){for(b=",one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,,fif,,,eigh,,,,twen,,for".split(","),o="",e+="",i=t=e.length;i>0;i-=3)p=e[i-3],q=e[i-2],r=e[i-1],o=(p>0?b[p]+" hundred"+(q>0||r>0?" ":""):"")+(q>0?(v=q<2?q+r|0:20+1*q,(b[v]||b[v-10]||b[v-20]||"")+(v>19?"ty":v>12?"teen":"")):"")+(1!=q&&r>0?(q>1?"-":p>0?"and ":"")+b[r]:"")+(e.substring(i-3,3)>0?", thousand , million , billion ".split(",")[(t-i)/3|0]:"")+o;return o}
since i don't think anyone else wants to take a crack at it