Page 2 of 4
Posted: Thu Mar 07, 2013 12:49 am
by RobertBe
Kweepa wrote:I'd prefer a byte count. What is the C64 line limit? Is it 4x40=160 'bytes'?
BASIC will let you use up to 255 bytes per line.
Truly,
Robert Bernardo
Fresno Commodore User Group
http://videocam.net.au/fcug
Posted: Thu Mar 07, 2013 4:18 am
by Shaun.Bebbington
Kweepa wrote:
Great! We can hide a line by numbering it 0!
It wasn't really an attempt to enter, since I think the rules are too strict for the VIC, although as Leeeeeee says the same game could
theoretically be entered as two lines. I'd prefer a byte count. What is the C64 line limit? Is it 4x40=160 'bytes'?
The reason for the competition is that it presents an interesting challenge, especially as BASIC 2 does not have else if conditions, nor while loops (although you can use a FOR loop to the same effect).
Regardless of the limits, there have been some amazing results, although no one has entered anything for the VIC-20, PET or C16/+4 yet. There is still time, more that 24 hours at the time of writing this
Regards,
Shaun.
Posted: Thu Mar 07, 2013 8:01 am
by Leeeeee
I've made Kweepa's program as a two liner available
here.
Here's the listing..
Code: Select all
0 X=0:Y=11:PRINT" L"L"B"B:FORI=1TO505:PRINTCHR$(32-3*(RND(1)<.3+L/44));:NEXT
1 FORA=-1TO0:O=7680+22*Y+X:POKEO,94:K=PEEK(197):X=X+(K=33ANDX>0ANDPEEK(O-1)=32)-(K=26ANDPEEK(O+1)=32):Y=Y+(K=52ANDY>0ANDPEEK(O-22)=32)-(K=44ANDY<22ANDPEEK(O+22)=32):POKEO-(K=13ANDB>0),32:B=B+(K=13):A=X<21:NEXT:L=L+1:B=B+1:GOTO0
Lee.
Posted: Thu Mar 07, 2013 8:11 am
by pallas
isn't 0 the default for GOTO? so you can remove the last character.
Posted: Thu Mar 07, 2013 9:25 am
by Leeeeee
Even using abbreviated keywords line 1 is about 120 characters too long to enter but yes you could lose that 0 from the end.
Lee.
Posted: Thu Mar 07, 2013 9:29 am
by Shaun.Bebbington
Leeeeee wrote:Even using abbreviated keywords line 1 is about 120 characters too long to enter but yes you could lose that 0 from the end.
Lee.
Great, thanks for that!
If you want to enter, please send the prg to Nigel Parker before the deadline, along with an explanation of how the program works. Obviously, Kweepa will have to take the credit for the initial listing and you obfuscated it into two lines of BASIC 2 for the VIC-20.
Nigel's email address may be found through
www.commodorefree.com
Kind regards,
Shaun.
Posted: Thu Mar 07, 2013 9:39 am
by pallas
it can be shortened further.
for example, the number "32" is used many times: it can be assigned to a variable in line 0 and this will save some chars from line 1.
Posted: Thu Mar 07, 2013 10:10 am
by Leeeeee
If you want to enter, please send the prg to Nigel Parker before the deadline,
It's Kweepa's program not mine. If Kweepa wants to enter the two line version I posted I have no objection.
Lee.
Posted: Thu Mar 07, 2013 11:15 am
by Mike
Kweepa's program could go into a single line, BTW.
Posted: Thu Mar 07, 2013 12:55 pm
by Mike
Here's my ultimate-rule-bending entry: '
bird.prg'.

Posted: Thu Mar 07, 2013 1:09 pm
by Kweepa
Thanks Leeeeee!
I'll enter it, why not?
You get some credit of course.
pallas, I considered that - before I added one more 32, apparently. Thanks!
Here's the final one-liner:
Code: Select all
0 forl=0to9:x=0:y=11:s=32:print"{clr}l"l"b"b:fori=1to505:printchr$(s-3*(rnd(1)<.3+l/44));:next:fora=-1to0:o=7680+22*y+x:pokeo,94:k=peek(197):x=x+(k=33andx>0andpeek(o-1)=s)-(k=26andpeek(o+1)=s):y=y+(k=52andy>0andpeek(o-22)=s)-(k=44andy<22andpeek(o+22)=s):pokeo-(k=13andb>0),s:b=b+(k=13):a=x<21:next:b=b+1:next:poke198,0
And the batch file to create it:
Code: Select all
petcat -l 1001 -w2 -o vicmaze.prg -- vicmaze.txt
c1541 -format vicmaze,20 d64 vicmaze.d64 -attach vicmaze.d64 -write vicmaze.prg
http://www.kweepa.com/step/vic20/games/vicmaze.zip
It comes out at 255 bytes, although for some reason petcat splits it into two lines

Posted: Thu Mar 07, 2013 1:27 pm
by Shaun.Bebbington
Mike wrote:Here's my ultimate-rule-bending entry: '
bird.prg'.

I'll tell Nigel to look out for some VIC-20 entries.
Regards,
Shaun.
Posted: Thu Mar 07, 2013 1:30 pm
by Mike
I already sent it to Nigel as e-mail, together with an explanation how the exploit works.

Posted: Thu Mar 07, 2013 1:36 pm
by Shaun.Bebbington
Kweepa wrote:Thanks Leeeeee!
I'll enter it, why not?
You get some credit of course.
pallas, I considered that - before I added one more 32, apparently. Thanks!
I've noticed that, on occasion, your bombs run out when they shouldn't
Regards,
Shaun.
Posted: Thu Mar 07, 2013 1:59 pm
by Kweepa
You really need to tap P lightly so as not to use multiple 'bombs'.
