| Author |
Topic:
how hard would this be to program?
[Locked] |
Eradiani
Title: Moderator/ EvEVault Staff
AE mid to deep
Posts: 527
Registered: 2002-5-3 02:18:49
|
Date Posted:
1/1/00 12:00am
Subject:
how hard would this be to program?
|
Koneg posted:
Eradiani posted:
LOL I'm sure they are looking for someone to make it themselves.. not pass it to a pre-made function 
**scratches head**
I would bet real money this function/library exists for every programming language you care to name, but hey... Have fun re-inventing that wheel if it really makes you happy. 
Well the way it was asked made it sound like it was a lab for a programming course in college (or at the very least you had to assume that there wasn't something out there that already did this). so yeah you sort of have to re-invent the wheel for that sort of thing
-----signature-----
|
GrymmDAOC
Posts: 241
Registered: 2001-12-6 13:04:16
|
Date Posted:
1/1/00 12:00am
Subject:
how hard would this be to program?
|
Now write it in Intercal!
-----signature-----
Now speccing 2h sword IRL.
|
|
|
Date Posted:
1/1/00 12:00am
Subject:
how hard would this be to program?
|
I thought real programers wrote in assembly.
|
Scarne
Title: Capo di Scientifico
Posts: 1,087
Registered: 2001-7-23 15:24:34
|
Date Posted:
1/1/00 12:00am
Subject:
how hard would this be to program?
|
It's easy since there are some basic patterns.
First, groups the digits of the number into the groups of three as we do with commas when writing the number out. Each group of the is written as "{blah-blah-blah} {billion|million|thousand|[nothing]|etc}" with a separator between groups. This lets you write out numbers as big as you have the names of the groups for.
For the groups of three digits themselves, they break down into "{blah} hundred {blah-blah}". So the hundreds digit is taken care of. Then you just need to do all the special case logic to write out the tens and ones digit for the group.
There are a few other special cases to suss out like skipping groups of "000", but it shouldn't be too bad.
-----signature-----
E Pluribus Unum
|
RHWarrior
Posts: 770
Registered: 2009-9-30 18:42:12
|
Date Posted:
1/1/00 12:00am
Subject:
how hard would this be to program?
|
I used to be a Perl programmer, then I took a Python to the knee!
-----signature-----
"Drink coffee - do stupids things faster with more energy! ...and I'm all out of beans..." -me
"  ou guys need to stop dick riding wow and compare everything to it. It never invented a godamn thing, just made it popular. " -tinkly
|