Code: Select all
0 fory=0to7:c=0:forx=7to0step-1
1 c=c-2^(7-x)*(peek(7680+y*22+x)=24):next:printc:next
Moderator: Moderators
Code: Select all
0 fory=0to7:c=0:forx=7to0step-1
1 c=c-2^(7-x)*(peek(7680+y*22+x)=24):next:printc:next
Code: Select all
0 fory=0to7:c=0:forx=0to7:c=c-2^x*(peek(7687+y*22-x)<>32):next:printc:next
Code: Select all
0 fory=0to154step22:c=0:forx=0to7:c=c+c-(peek(7680+y+x)<>32):next:printc:next
Code: Select all
1 OPEN1,3:PRINT"{HOME}";:FORY=1TO8:S=0:FORX=1TO8:GET#1,A$:S=2*S-(A$<>" "):NEXT:PRINTS"{LEFT,2 SPACE}":NEXT:CLOSE1
cool - shortened to 1 line of code. One of the criteria for the "Holy Grail" class of utility programs. Also simplified the bit calculation. I am impressed sir!Leeeeee wrote:You can run x forward, avoid the 2^x without using an extra variable and remove the need for doing y*22 every time like this ..
.. this could be made faster by putting the 7680 and 32 into variables but I don't think speed is too much of a problem in such a short program.Code: Select all
0 fory=0to154step22:c=0:forx=0to7:c=c+c-(peek(7680+y+x)<>32):next:printc:next
Lee.
Code: Select all
Q
..****..
.*....*.
*......*
*......*
*......*
*......*
.*....*.
..****..
? _