|
|
Darren New <dne### [at] sanrrcom> wrote:
> You would be surprised. I've had people do things like pass the number
> of columns wide that the printer report should be in index zero of a
> floating point array indexed by customer age, just so they wouldn't have
> to spend 20 minutes to recompile other parts of the program when they
> changed what variables are shared between programs.
Sounds familiar. The job came down to a lot of signal processing, and I had a
coworker who needed to improve his programming ability, so he decided to write
a Sudoku solver on his own time. Of course you need to keep track of which
numbers are possible, so in each square for 1-9 a '1' represented a possible
number while a '0' mean that possibility was ruled out. Why not? Makes sense.
But we need to store that data, so lets have '1' correspond to a 1, '10'
correspond to a 2, '100' to 3, and so on up to 10^8. Just add 'em up. (so
1100 == 3 and 4 possible.) Oh, and let's just store that as a real number
since we'll be doing all those log10's anyway. I was unable to convince him
otherwise, which probably reflects more badly upon me than him, but at least no
one else ever had to see it, and at least I think he used double precision...
- Ricky
Post a reply to this message
|
|