Jump to content
Bunsen

BASIC Ten-Liners - Contest 2014

Recommended Posts

After the fun and success of last year at the NOMAM there is another programming competition this year. This year Turbo Basic XL is allowed. Besides speed advantages there are a few other advantages in Turbo Basic.

Here are the conditions of the competition:
- 10 lines of Turbo Basic XL code (pure Atari Basic is also allowed)
- It must be a game
- Input medium of the game arbitrarily (joystick , paddle , keyboard, ... )
- Abbreviations may be used to increase the maximum line length
- No reloading of data or parts of the program
- Call of machine language programs is not permitted ( X = USR ( 1536) )
- POKing is allowed (eg change the DL, PM graphics)
- Deadline: Saturday 26 April , 11 pm (remote posts : Wednesday, April 22)
- Voting: Saturday 26 April , 11.30 pm , Awards Ceremony : Sunday, 27 April , 0 am
- Only physically Attendants may vote
- Remote contributions are nevertheless allowed. They have to arrive until Wednesday 22 April 11.59 pm at GKANOLD - äht - GMAIL dot COM

(all times CET - central european time)

We also have some donated prizes, more donations are still gladly accepted .

  • Like 7

Share this post


Link to post
Share on other sites

Bobby, I would say: allowed. Example?

 

So far there are already 3 entries.

 

Jumpsheep by fdingler

Paddleship by Bill Kendrick

Sijmen by me

Share this post


Link to post
Share on other sites

Well, the idea was, I wanted to use a Super IRG style mode which runs off of a VBI., and to use this in Graphics 2. The idea is, it would save space (1K needed for font) and help the game to run faster. It wouldn't use USR calls, just a change to the VBI pointer.

 

To get to less than 10 lines will be a challenge to be sure. :)

Share this post


Link to post
Share on other sites

Only source-code are allowed? With no external data? (for example: font set)?

=====================EDIT:

One more question: can we use POKE 82,0 to edit sources?

Edited by Sikor

Share this post


Link to post
Share on other sites

Any trick you can think of to squeeze code into one logical line is allowed, I am sure. This includes abbreviations, POKE 82,0, removing unneeded spaces. As for font set, I have a program which can fix that, called CONVERT.BAS ... converts your font set into either DATA statements or string assignments. Only prob is, those string assignments can eat up a lot of lines, unless you are working in Graphics 1 or 2 which only allows you 512 bytes for your char set. That will still eat up 5 lines of your code tho.

Share this post


Link to post
Share on other sites

I should think no USR also means no VBI or DLIs.

 

In 10 lines using ASCII in DATA, an assembler routine of ~ 1K could be fitted, that would be an extreme unfair advantage.

VBI or main loop, little difference - and a VBI routine could quite easily just break out and become the mainline program anyway.

 

I might have to whip something up... I have a trick or 2 to cram more stuff in 10 lines.

Share this post


Link to post
Share on other sites

Thanks for the invite Bunsen :thumbsup:

 

This contest is a great way for anyone to learn to program on the Atari 8)

 

If there is anyone needing any help getting started just post, there are lots of people who can help. Don't be put off by some of the tecnhical discussions you only need a few commands to have something moving around the screen, and before you know it you will have a little game running; it's all a bit of fun :)

 

p.s. I'm in :grin:

Share this post


Link to post
Share on other sites

Now I am a lttle bit unsure of myself. Bobby, I don't know exactly what you mean. As Rybags explains use of VBI is some kind of machine language use and similar to USR calls.

 

But on the other hand I think it makes no sense to draw too many rules, because it should be a fun contest. It also does not really matter whether one is first, third or fifth.

Maybe it is better to allow machine calls? But then it is not likely a basic contest.

 

Paweł, yes POKE 82,0 is allowed and yes, only source code is allowed, no loading of fonts or other data.

 

Jason, great that you are in :)

Share this post


Link to post
Share on other sites

I've got one in the pipeline - 8 lines so far but hoping to compact down a bit.

 

There's some exploits that can be used to cram more into a line and some programming trickery that can help too:

 

- normal limit with E: is only 120 bytes input to a line. Actually, BASIC allows 256 bytes to be input but this limit is rarely approached and can only occur when doing something like ENTER "<filespec>". To get such large lines, an editor on the PC can be used, then use the H: device in the emulator with ATASCII translation to get the lines into memory. There are downsides though, changing the program will be tedious and including special characters somewhat harder. Best method is probably to do the program e.g. as 30 lines of code then combine lines in an editor once finalized.

Note also that there's a limit to a stored line of program (256 bytes?) and it's fairly easy to overrun this. Especial case is if there's lots of numeric constants in a line.

 

- use boolean logic. e.g. in the game I'm doing, speed/size advantage for moving something vertically:

S=STICK(0) : V=(S=13)-(S=14) : Y=Y+V

- use infinite loop, change loop variable to break out. The problem with using GOTO for program control within the main loop is that the main loop will start at the beginning of the line and the end of the main loop with the GOTO can't have anything following it.

FOR L=1 TO 2 STEP 0
<rest of main loop>
IF C=1 THEN L=2 : REM set breakout condition so we can get out of loop
NEXT L
Edited by Rybags
  • Like 3

Share this post


Link to post
Share on other sites

I'll do what's needed to keep it in the 10 lines... equally you could do the same trick using legacy Atari gear only, so it's not really cheating.

 

I might have a handicap anyway - I'll probably only use the standard Basic, so you lose out a little there.

Share this post


Link to post
Share on other sites

 

- use infinite loop, change loop variable to break out. The problem with using GOTO for program control within the main loop is that the main loop will start at the beginning of the line and the end of the main loop with the GOTO can't have anything following it.

 

 

You can use remaining line space for DATA:

 

1 IF A=B THEN 3:DATA 1,2,3,4,5,6

 

Does not look nice, but helps to work within the given limit...

Share this post


Link to post
Share on other sites

I don't get how poke 82,0 helps with this contest. Doesn't it just make the left margin disappear (be 0 pixels)?

You has longer lines. Atari Basic (and Turbo Basic XL) get maximum line lengths 3-lines. So, you has 6 letter more for each line (60 at all). Only few? Example: PL.0,0 - one instruction more in line.

Share this post


Link to post
Share on other sites

I can't help myself! I've written two more!

  • "Planets"
    two-player, joystick-controller 'artillery game' with planets and orbital gravity
  • "Slice"
    one-player, Touch Tablet-controlled (paddle should work, too, but might be difficult) game where you collect dots before they fly off the screen. ("Fruit Ninja", but not really; kinda also like "Stampede" or "Kaboom!")

I've got 2 or 3 more ideas, and apparently have some small amount of free time lately to work on these. :) So you may see more! If it turns out that I have too many submissions (there was no limit mentioned in the rules, but I'd fully understand) then I'm happy to pick one or more games that I'd like to submit. (I'd pick one(s) that I think have a chance at winning the contest, of course ;) )

 

I have to say, this has been devilishly fun. My day job involves numerous huge Linux servers and giant databases on systems with 16GB of RAM each, so trying to fit 11 lines of code for a working game down into 10 lines, so that it adheres to the rules, is a very different kind of puzzle. ;)

  • Like 5

Share this post


Link to post
Share on other sites

8th game registered :thumbsup:

 

Jumpsheep by fdingler

Paddleship by Bill Kendrick

Sijmen by me

Squirrel by fdingler

Shmup by Bill Kendrick

Colfusion by Irgendwer

Planets by Bill Kendrick

Slice by Bill Kendrick

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...