Commodore FREE One Liners competition.

Basic and Machine Language

Moderator: Moderators

Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

Kweepa wrote:You really need to tap P lightly so as not to use multiple 'bombs'. :)
I've found the problem: the variable B can go negative even if you have no bombs (but obviously, it won't activate if zero or below).

Regards,

Shaun.
Without context, we are only data.
User avatar
Witzo
Vic 20 Afficionado
Posts: 381
Joined: Thu Dec 01, 2011 9:14 am
Location: The Hague

Post by Witzo »

Here is my submission for the Oneliner compo. It's for the unexpanded VIC20:

http://raoulm.home.xs4all.nl/products/commodorefree.d64

It's the file MINISCROLL.
Unfortunately, I didn't manage to stay within two lines; it's three lines. There's a two-line version included that shows some different behaviour that I can't explain.
The 3-line version is 173 bytes of basic, so it is within Mr. Bebbington's set limit of 640 bytes.
So I'm not sure whether or not my submission qualifies. I'm submitting it anyway because of the work I put in :-)

Tested on a real VIC.
Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

Witzo wrote:Here is my submission for the Oneliner compo. It's for the unexpanded VIC20:

http://raoulm.home.xs4all.nl/products/commodorefree.d64

It's the file MINISCROLL.
Unfortunately, I didn't manage to stay within two lines; it's three lines. There's a two-line version included that shows some different behaviour that I can't explain.
The 3-line version is 173 bytes of basic, so it is within Mr. Bebbington's set limit of 640 bytes.
So I'm not sure whether or not my submission qualifies. I'm submitting it anyway because of the work I put in :-)

Tested on a real VIC.
Okay, my 640 bytes reference was a joke, in case anyone didn't get it. The competition is for one or two lines of Commodore BASIC; the number of bytes used is irrelevant.

You should really send it to Nigel @ Commodore FREE, but I'll submit it for you.

Regards,

Shaun.
Without context, we are only data.
Leeeeee
soldering master
Posts: 396
Joined: Fri Apr 23, 2004 8:14 am

Post by Leeeeee »

The bomb logic can be fixed by changing the bomb code to..

Code: Select all

C=(K=13ANDPEEK(O+1)=35ANDB>0):B=B+C:POKEO-C,32
The following single line version with the fixed bomb logic is available here.

Code: Select all

0 X=0:Y=11:PRINT" L"L"B"B:FORI=1TO505:PRINTCHR$(32-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)=32)-(K=26ANDPEEK(O+1)=32):Y=Y+(K=52ANDY>0ANDPEEK(O-22)=32)-(K=44ANDY<22ANDPEEK(O+22)=32):C=(K=13ANDPEEK(O+1)=35ANDB>0):B=B+C:POKEO-C,32:A=X<21:NEXT:L=L+1:B=B+1:GOTO0
Lee.
User avatar
Witzo
Vic 20 Afficionado
Posts: 381
Joined: Thu Dec 01, 2011 9:14 am
Location: The Hague

Post by Witzo »

Shaun.Bebbington wrote:
Witzo wrote:Here is my submission for the Oneliner compo. It's for the unexpanded VIC20:

http://raoulm.home.xs4all.nl/products/commodorefree.d64

It's the file MINISCROLL.
Unfortunately, I didn't manage to stay within two lines; it's three lines. There's a two-line version included that shows some different behaviour that I can't explain.
The 3-line version is 173 bytes of basic, so it is within Mr. Bebbington's set limit of 640 bytes.
So I'm not sure whether or not my submission qualifies. I'm submitting it anyway because of the work I put in :-)

Tested on a real VIC.
Okay, my 640 bytes reference was a joke, in case anyone didn't get it. The competition is for one or two lines of Commodore BASIC; the number of bytes used is irrelevant.

You should really send it to Nigel @ Commodore FREE, but I'll submit it for you.

Regards,

Shaun.
Thanks! I have sent it to commodorefree at commodorefree.com since that's what I found on the website.

I've ran some of the other entries; they win! I only know how to type it on the VIC, so those over-200-byte lines are out of my league.
Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

Witzo wrote:It's the file MINISCROLL.
Unfortunately, I didn't manage to stay within two lines; it's three lines. There's a two-line version included that shows some different behaviour that I can't explain.
The 3-line version is 173 bytes of basic, so it is within Mr. Bebbington's set limit of 640 bytes.
So I'm not sure whether or not my submission qualifies. I'm submitting it anyway because of the work I put in :-)
Here is a suggested fix to your code:

Code: Select all

0 a$="                              commodore free":b=36864:pokeb,2:pokeb+1,
75:pokeb+2,162:pokeb+3,130:print"{CLR}
1 a$=right$(a$,44)+left$(a$,1):print"{HOME}"a$" ":forj=1to100:next:goto1
It now doesn't flicker as it scrolls, self-clears as it writes and the scrolly is seamless :-)

See if you can make further improvements to it (would a colour roll be possible? I don't know.)

Regards,

Shaun.
Without context, we are only data.
User avatar
Witzo
Vic 20 Afficionado
Posts: 381
Joined: Thu Dec 01, 2011 9:14 am
Location: The Hague

Post by Witzo »

I'll study that!
But I won't have time for it before the deadline, so my submission will have to stand, clumsily, as it was.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Leeeeee wrote:The bomb logic can be fixed by changing the bomb code to..

Code: Select all

C=(K=13ANDPEEK(O+1)=35ANDB>0):B=B+C:POKEO-C,32
Heh, I made the same change in my notes for the submission. Since that makes it more than 256 bytes (with some other changes I made), I decided not to change it. (petcat makes it 2 lines regardless, so it's more of an aesthetic decision.)

[EDIT] Actually, your version is neater, and <256 bytes, so I'll go with that!
[EDIT-EDIT] How do you make these into one line prgs? petcat mucks it up.
[EDIT-EDIT-EDIT] Here's my submission version:
http://www.kweepa.com/step/vic20/games/vicmaze.zip
With notes and d64 included. I forgot to credit anyone. :(

Code: Select all

0 x=0:y=11:print"{clr}l"l"b"b:s=32: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):d=(k=13andb>0andpeek(o+1)<>s):pokeo-d,s:b=b+d:a=x<21:next:b=b+1:goto
Leeeeee
soldering master
Posts: 396
Joined: Fri Apr 23, 2004 8:14 am

Post by Leeeeee »

How do you make these into one line prgs? petcat mucks it up.
How I do it is I work on the multi line version in Vice and save that. I then hex edit the saved .prg file to remove the line links and replace them with colons. Lastly I fix the one remaining line link by hand and save the edited .prg file.

Simple when you know how.

There's probably lots of better ways to do it but as I've always got the tools open it takes so little time it's not worth the effort of finding a more efficient way.

Lee.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Here is my entry. I'm not sure where to send it.

http://sleepingelephant.com/denial/diver.prg

It's a one line game. Dive as deep as you can go while avoiding obstacles. You may need to RUN more than once because instant death is very possible. Use < and > to steer.
High Scores, Links, and Jeff's Basic Games page.
Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

Jeff-20 wrote:Here is my entry. I'm not sure where to send it.

http://sleepingelephant.com/denial/diver.prg

It's a one line game. Dive as deep as you can go while avoiding obstacles. You may need to RUN more than once because instant death is very possible. Use < and > to steer.
This is Commodore FREE's competition, so www.commodorefree.com should have contact details there, but I'll submit it for you. I think it's commodorefree@commodorefree.com, but I use Nigel's personal email address, which I don't want to share publicly.

Edit: Please review this (see the magazine):

"Please provide as much information as possible with your submissions, i.e., what you were trying to achieve, and how far you think you got to achieving it; how you created your program (genuine one liner, BASIC 7 or whatever)."

As I'm submitting it for you, I have no idea what to write along with the entry as I haven't written the program.

Regards,

Shaun.
Last edited by Shaun.Bebbington on Fri Mar 08, 2013 9:39 am, edited 1 time in total.
Without context, we are only data.
Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

Thanks for all of the entries people! It's good to see that all of the popular Commodore 8-bit machines have an entry :-) and with well over a dozen disk images (and many more programs) to try out, and only three disqualifications (which have more than two lines of Commodore BASIC), I don't see what all of the fuss was about over the rules. I think something was lost in translation.

Regards,

Shaun.
Without context, we are only data.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Wow, Jeff, that's almost too fast!
Also, you managed to fit it into two standard BASIC lines. Kudos!
Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

The deadline has passed now, thanks for your entries :-)

There is no reason to stop programming though!

Regards,

Shaun.
Without context, we are only data.
Shaun.Bebbington
Vic 20 Dabbler
Posts: 78
Joined: Fri Jan 20, 2006 3:41 am

Post by Shaun.Bebbington »

Witzo wrote:I'll study that!
But I won't have time for it before the deadline, so my submission will have to stand, clumsily, as it was.
Now that the competition is over, here is your listing which will change the colours of the text whilst it's scrolling:

Code: Select all

0 b=36864: poke b,2: poke b+1,75: poke b+2,162: poke b+3,130: print"{CLEAR}":a$="                     commodore free
1 a$=right$(a$,44)+left$(a$,1): print"{HOME}" a$ " ":for i=0 to 99:next:poke 646, 2+rnd(.)*6: goto 1
I've added some spaces to make it more readable.

You'd type it into a real VIC-20 like this:
Image
The scroll logic reads the string variable a$ from right to left and adds the first character from left to right to the end of the string. So, each pass will move the characters once from right to left, creating the scroll.

The random colour generator basically will pick a colour from 2 to 7 using the rnd command and poke that to location 646. As the screen colour is white (colour 1), that is avoided so that the text doesn't disappear from time to time.

There are much more knowledgeable people here who will put the whole code into just one line. I don't yet know of these tricks, but would like to learn such feats.

Regards,

Shaun.
Without context, we are only data.
Post Reply