Ok, certainly nothing special, but I was looking to waste a bit of time this evening and came up with this: 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 So, who can make the program shorter while keeping the exact same display? "Sheldon Simms" wrote in message news:pan.2004.02.13.07.03.04.232675@yahoo.com... > > Ok, certainly nothing special, but I was looking to waste a bit of > time this evening and came up with this: > > 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 > > So, who can make the program shorter while keeping the exact same > display? Sorry, I couldn't resist! You made that too easy with "C=0"! :-) But I'm sure there's a *real* way to make it shorter! 1GR:HOME:D=176:A=1616:FORX=4TO35STEP2:COLOR=C:VLIN0,39ATX:VLIN0,39ATX+1:H=IN T(C/10):POKEA+X,H+D:POKEA+X+1,C+D-10*H:C=C+1:A=1744-A+1616:NEXT Actually, am I missing something? Shouldn't "A=1744-A+1616" be changed to "A=3360-A"? -- Peter Watson -- Write to MSDOS disks on the Apple IIgs? -- Impossible! ;-) On Fri, 13 Feb 2004 02:03:04 -0500, Sheldon Simms 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 On Sun, 15 Feb 2004 13:24:31 -0500, I wrote: > On Fri, 13 Feb 2004 02:03:04 -0500, Sheldon Simms > 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? > > 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) 1GR:HOME:FORX=4TO35:COLOR=C:H=C>9:POKE1616+128*U+X,176+K*(C-11*H)+H: VLIN0,39ATX:C=C+K:K=K=0:U=U=K:NEXT (102 characters) Paul Guertin pg@sff.net On Mon, 16 Feb 2004 03:30:26 +0000, M. Pender wrote: > On 2/15/04 9:39 PM, in article p77030pvi0llq901d2sdbq9eom7j7p1ima@4ax.com, > "Paul Guertin" wrote: > >> 1GR:HOME:FORX=4TO35:COLOR=C:H=C>9:POKE1616+128*U+X,176+K*(C-11*H)+H: >> VLIN0,39ATX:C=C+K:K=K=0:U=U=K:NEXT >> >> (102 characters) >> >> Paul Guertin >> pg@sff.net > > I thought the GR command clears the display; that would mean the 'HOME:' > unnecessary too. Unfortunately, I can't test it right now. :-( GR doesn't clear the text screen, so if you have garbage down at the botton when you start, it stays there. Also, without HOME, the numbers at the bottom get scrolled up into the colors, but that problem can be solved by changing 1616 to 1744 in the code above. Sheldon