comex wrote:
>Thoughts?  Can I hear some other peoples' character counts? 

I don't want to give away competetive details, but I'll give some
approximate information.  The first working version of my code to generate
and print the primes was about 350 characters.  That was roughly half
for generation and half for printing.  Both parts can get smaller.

Choice of output format makes a big difference.  There's some ambiguity
in the spec here, so it's not clear how far you can squash that part.
I doubt root would accept an output format where each prime is represented
by a single byte of the prime's value, but if e did then the output
part would be under 20 characters.  More realistically, there's room
to argue whether you should be allowed to do hexadecimal with `digit'
characters that have adjacent ASCII values.

For generation, I wonder about the comparison between a compressed list
of primes (with a small decompression program) and generating the primes
from first principles.  I think in going up to 255 we're fairly close
to the break-even point where both approaches give similar program size.
If we were going up to 1000, say, I'd be confident that the best available
list compression is actually the arithmetical generation program.

-zefram

Reply via email to