[Tutor] please return flys in ointment
Jim Mooney
cybervigilante at gmail.com
Sun Jul 7 08:47:03 CEST 2013
On 6 July 2013 22:52, Dave Angel <davea at davea.name> wrote:
The
> other author does not use hyphens or commas in the words. He ends each
> string with a blank. And he neglected to handle zero.
I did that at first, but I figured I should do it up brown and come
close to human notation, although commas and hyphens made it harder,
and a comma introduced my first bug. I think I'm learning more from
this "trivial" program than from the book I'm studying. Getting it
totally right is more difficult that I thought it would be.
And of course, Zero is the exception to end all exceptions, so it
should always be kept in mind ;')
But this and other advice will keep me busy for awhile. Especially
since Arizona is going through a heat wave my crummy AC can't handle,
even at night, so my computer time is cut way down, especially if my
temp monitor screams. I can stand the heat but I have learned from sad
experience that a laptop CPU, with their rotten air circulation,
cannot. And those overpriced little "laptop fans" are a joke. The big
tip about laptops in hot weather is - Don't Watch Videos! I can watch
the temp monitor climb the minute I go to YouTube.
I'm well along with this, but a thought that occurred to me after I
realized our number-naming is far from rational - we're just used to
it - was to name the numbers rationally, then at the end translate
them with a regex. i.e. the teens are:
oneteen, twoteen, threeteen, the tens are onety, twoty,
threety, the hundreds are onedred, twodred, thousands are onesand,
twosand, etc. illion is all the same ending, so use the prefix -
onemill, onebill, onetrill, onequad. No hyphens - so fifty-six is
fiftysix. This is how numbers oughtta be, anyway - and Zero is
Forbidden ;')
That would make it all very simple - then translate it to human speech
with a monstrous regex. Probably the same amount of work in the end,
though.
> He also is buggy beyond a nonillion-1.
Interesting. I did a linear test first, but never got to high numbers.
It was only with a test that was random, so it got a much higher
number now and then, that I got a bug. The downside is sometimes it
succeeded with the same number of runs that it failed on, since it's
random, so multiple runs were required.
Useful to remember, though, since I think it's natural to grab for a
linear test and figure random tests won't catch everything. But a
shotgun sometimes hits more than a rifle.
--
Jim
There is evidence the North Polar icecap will disappear sooner than
expected, due to unforeseen chaotic events and multiple positive
feedback loops. Theorists on both sides can debate it, but Mother
Nature will have the last word.
More information about the Tutor
mailing list