Jump to content
IGNORED

10 liner Basic/XB competition launched


Vorticon

Recommended Posts

Guys, please make sure to post your official entries on the submission thread so they can be included in the final poll and allow the group to test play all of them. It's hard to keep track of scattered posts otherwise.

Here's the link again: http://atariage.com/forums/topic/291836-official-10-liner-program-competition-thread/

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Working intensive on my entry. Lost some time because of a one-week sickness.

In case you try to squeeze every byte into your lines, you are able to figure out how many bytes are free in each line by adding as many "!" characters as the line will still fit without throwing "* Line Too Long".

This will show you how many tokenized bytes are still available in each of your lines.

 

And if you have space in one line but are low on bytes in another, you can replace a hardcoded number by a numeric variable.

 

2 CALL CLEAR :: CALL CHAR(100,"1234567890123456789012345678901234567890123456789012345678901234",R,"1234567890123456789012345678901234567890123456789012345678901234")

--> * LINE TOO LONG

 

But this fits:
1 Q=100 :: R=Q+4
2 CALL CLEAR :: CALL CHAR(Q,"1234567890123456789012345678901234567890123456789012345678901234",R,"1234567890123456789012345678901234567890123456789012345678901234")

 

Also you can skip remaining zeros on Character Definitions like this

1 CALL CHAR(33,"0")

defines the Character 33 as completely empty.

 

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

You can actually do this:

CALL CHAR(33,"")

 

The "LINE TOO LONG" problem is also affected by tokenizable commands.  For instance, CALL is tokenized but HCHAR is not.  Once you get around the editor line entry limitation (for instance, using Notepad++ and Classic99 "PasteXB" function,) playing around a little can help you squeeze more into a single line.

 

In XB line 10 is 21 bytes long, and line 20 is 7 bytes long.

10 CALL HCHAR(1,1,32,30)
20 PRINT A$

 

Using shorter line numbers and variable names also helps as both are stored as text.

10 NUMBER=123.45 ! Variable is six characters, the number is six characters
20 GOTO 32768 ! Line number is five characters

 

And, of course, remarks (in both REM and ! statements) are stored as text.

 

I have swapped some some statements between lines to make them fit without triggering "LINE TOO LONG". Using short functions like RPT$() or TAB() can help with PRINT or DISPLAY-AT statements.

 

As an example, I can paste the following into Classic99 without over-flowing:

 

1DIM G(19,23)::CALL SCREEN(2)::READ A$,B$::CALL CHAR(96,A$,128,A$,136,A$)::CALL CHAR(43,B$)::FOR I=2 TO 14::CALL COLOR(I,16,2-3*(I=13)-9*(I=14))::NEXT I
2CALL CLEAR::DISPLAY AT(1,2):"QI\//";TAB(32);"/\\B"::CALL HCHAR(3,4,98,24)::CALL HCHAR(24,4,99,24)::CALL VCHAR(4,3,97,20)::CALL VCHAR(4,28,96,20)

Both lines are packed with work and exceed the editor buffer, but do not exceed the line limit after tokenization (crunching,) but just moving one statement to the other line will cause "LINE TOO LONG".  I also tried playing with using RPT$() in the character definitions, but sacrificing one line to a DATA statement just worked out better.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Your line: 

CALL VCHAR(4,3,97,20)::CALL VCHAR(4,28,96,20)

 

In RXB can be CALL VCHAR(4,3,97,20,4,28,96,20)

 

Would save you some bytes used in token buffer. (Thus not using :: or CALL or VCHAR again.

 

Edited by RXB
  • Like 3
  • Thanks 2
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...