[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A One Liner



On Fri, 13 Feb 2004 02:03:04 -0500, Sheldon Simms <sheldonsimms@yahoo.com>
wrote:

> 1GR:HOME:C=0:D=176:A=1616:FORX=4TO35STEP2:COLOR=C:VLIN0,39ATX:
> VLIN0,39ATX+1:H=INT(C/10):POKEA+X,H+D:POKEA+X+1,C+D-10*H:C=C+1:
> A=1744-A+1616:NEXT

(143 characters)

> So, who can make the program shorter while keeping the exact same
> display?

1. Remove "C=0:" because Applesoft initializes numeric variables
to 0. (-4 chars)

2. Change the second to last command to "A=3360-A" (-5 chars)

3. Remove "D=176:" and replace "D" with "176" twice (-2 chars)

4. Change "H=INT(C/10)" to "H=C>9" (-6 chars)

5. Remove "STEP2", reorder instructions, add "X=X+1:" and
change "X+1" to "X" twice (-3 chars)

1GR:HOME:A=1616:FORX=4TO35:COLOR=C:H=C>9:VLIN0,39ATX:
POKEA+X,176+H:X=X+1:VLIN0,39ATX:POKEA+X,176+C-10*H:C=C+1:
A=3360-A:NEXT

(123 characters)

Paul Guertin
pg@sff.net