IGNORED

# BASIC 10 Liner Contest 2022

## Recommended Posts

Cool, I found an alternative to:

r=(a<b)-(a>b)

and also save a couple of keystokes in the process.

Can anyone figure out what it is?

##### Share on other sites

Might it be this?

r=abs(b-a)

Some years ago, I started a proto of something similar, where you have to guide the followers to traps that destroy them (and it also kills you). IIRC, it was using TurboBasic XL, and I discarded it because it wasn't fun after all. Now, I'm sure that Preppie has a winner.

##### Share on other sites

Close, I discovered this:

r=SGN(a-b)

so if 'a' variable is my character and 'b' is the hazard if a<b a-b becomes negative and SGN makes that -1. Likewise if a>b a-b becomes a positive number, which SGN then make it 1.

I checked with Atari BASIC tutorial by Robert A. Peck on Archive.org, which discusses SGN (p.58,59, p.60 of the archive page), I just don't know if Atari BASIC accepts an equation within a SGN fuction. The guide does go on about how space can be saved by using SGN instead of having 3 IF statements, which leads me to believe an equation within a SGN fuction is allowed.

##### Share on other sites

49 minutes ago, vitoco said:

Might it be this?

r=abs(b-a)

I meant:

r=sgn(b-a)

##### Share on other sites

3 hours ago, vitoco said:

Some years ago, I started a proto of something similar, where you have to guide the followers to traps that destroy them (and it also kills you). IIRC, it was using TurboBasic XL, and I discarded it because it wasn't fun after all.

Proto found... I've uploaded a video for this proof of concept:

Should I resume this little project? What do you think?

##### Share on other sites

I've played some similar games and I think BASIC game books from the 80s would of had something of that style on offer, though I don't recall seeing a 10-Liner, so it should be interesting.

The versions I normally come across would have a Hazard remain, even after an Enemy runs into it, so it's an interesting twist to the game.

##### Share on other sites

3 hours ago, vitoco said:

Proto found... I've uploaded a video for this proof of concept:

Should I resume this little project? What do you think?

It reminds me Zombies, the Vic 20 game I ported to A8 with original and enhanced graphics.

In your game pits disappear when touched.

Go for it!

##### Share on other sites

2 hours ago, Philsan said:

It reminds me Zombies, the Vic 20 game I ported to A8 with original and enhanced graphics.

Hey! I've seen that before. I thought it was where I got the idea, but it says it's 2020, and my source file is 2019.

It was not TurboBasic XL, just plain Atari BASIC, trying to do something for the PUR-80 after the "stock" restriction, but the code was a mess ?

2 hours ago, Philsan said:

In your game pits disappear when touched.

5 hours ago, AMSDOS said:

The versions I normally come across would have a Hazard remain, even after an Enemy runs into it, so it's an interesting twist to the game.

Yes. This way, you cannot hide behind a single spot and let them die to go to the next round.

3 hours ago, Philsan said:

Go for it!

A lot of fine tunning is required to make it interesting. That (and the mess) made me drop this project.

If I cannot find a fresh idea or concept, I'll take a look into it again.

##### Share on other sites

19 hours ago, vitoco said:

Yes. This way, you cannot hide behind a single spot and let them die to go to the next round.

The games I've played of this nature force you to move before the enemy moves like a Board Game kind of thing, though this seems to be better, making it more of an Action game.

I don't know what else to suggest, perhaps a Time Delay thing and if the player takes too long to complete a Nasty comes after you regardless of where the holes are, though that seems to be more of a problem if the game played like a Board Game.

##### Share on other sites

Only a little heads-up to the people that does not read the programming sub-forum: You can now write in FastBasic for the Atari 5200, so there is one more platform to compete in the contest!

Have Fun!

• 4
• 1
##### Share on other sites

15 hours ago, dmsc said:

Only a little heads-up to the people that does not read the programming sub-forum: You can now write in FastBasic for the Atari 5200, so there is one more platform to compete in the contest!

Have Fun!

Now, we are waiting for your entry!!! ?

##### Share on other sites

On 2/14/2022 at 2:44 AM, AMSDOS said:

Re:Compression, I think if you have the tools, anyone would have no choice but to take advantage of it. Is it hidden? Not really because it's all within the code, the algorithm simply extracts it back into what it needs to be. Compression would cross the line if the 1st line read 'Decode' followed by 9 lines of Gibberish and submitted to the contest and once that 10-liner is Decoded it's no long a 10-Liner.

Some of my earlier 10-Liners deal with some form of Compression to produce something which wouldn't seem to be possible normally to do in 10 Lines. The only compression I haven't used, but have examples of is UUEncoded, though I've only used it within Machine Code, I don't see why it couldn't be used as room data or data for a maze.

Re:PUR-80 Category, I knocked up something yesterday afternoon, I kinda felt like it's the sort of category where you put what you need in and then your left with one last thing to do, add a nastie to the game and by then you've got a PUR-80 game on your system. Any elaborate ideas need to be thrown out the window because it won't fit. Having said all that, I may get something in which is along the lines of you finding the exit before the Following Love Heart catches you, though I don't see it being anywhere as good as @Preppie's.

Interesting compression ideas!

This year I am using a form of compression to minimize the size of BASIC data statements for character animation with pseudo graphics on the Atari 2600.

I have to find more of the right characters codes:

##### Share on other sites

On 3/4/2022 at 3:23 AM, Mr SQL said:

Interesting compression ideas!

This year I am using a form of compression to minimize the size of BASIC data statements for character animation with pseudo graphics on the Atari 2600.

I have to find more of the right characters codes:

On 3/4/2022 at 3:17 AM, vitoco said:

Now, we are waiting for your entry!!! ?

I'm waiting for an Atari 7800 edition of FastBASIC!

On 3/4/2022 at 3:23 AM, Mr SQL said:

Interesting compression ideas!

This year I am using a form of compression to minimize the size of BASIC data statements for character animation with pseudo graphics on the Atari 2600.

I have to find more of the right characters codes:

A few years ago I was playing around with the BIN\$ function my computer has to store vast amount of maze information within a limited amount of space, which seems to be one of the easiest ways of compressing information within BASIC, though it's somewhat limited because you're limited to 1 = Wall, 0 = Space. Other Overlays need to be presented if a Maze needs more detail, although information about a Baddie or Hazard could simply be placed in a Random spot on the condition it's on a Space. A game with fixed Hazard positions in multiple locations would probably be better with a seperate overlay, in 2017 I wrote Mini Ball Maze, which had all the information stored within the Data, though it's probably quite possible to improve on that by making it larger by storing the Maze & Hazards as seperate Binary Representation overlays.

##### Share on other sites

• 2 weeks later...

THE RULES!

Am I in Russia?

Cant say this , cant say that.. MY CODE has to conform?

I thought it was a ten line code  in basic..

• 1
• 1
##### Share on other sites

So if i can place 80 characters per line than it is a 800 character contest.?  lets slice bread.. btw i am not coding i am just appalled at this thing called a contest and what you have turned it into.

##### Share on other sites

Good luck to all the contestants! While there still are two weeks to go, I'm not likely to have the time to get an entry this year as well. I do like the variation of systems though.

##### Share on other sites

1 hour ago, carlsson said:

Good luck to all the contestants! While there still are two weeks to go, I'm not likely to have the time to get an entry this year as well. I do like the variation of systems though.

I managed to squeeze a game down for the PUR-80 category in Locomotive BASIC.

With a little bit of time left I can expand on it a little, add some graphics, sound and put that into the PUR-120.

There doesn't seem to have many entries or maybe they'll appear at closing time I'm guessing, though there's some interesting entries in the PUR-80 category which appear to be tough to beat.

##### Share on other sites

On 3/4/2022 at 5:36 PM, AMSDOS said:

A few years ago I was playing around with the BIN\$ function my computer has to store vast amount of maze information within a limited amount of space, which seems to be one of the easiest ways of compressing information within BASIC, though it's somewhat limited because you're limited to 1 = Wall, 0 = Space. Other Overlays need to be presented if a Maze needs more detail, although information about a Baddie or Hazard could simply be placed in a Random spot on the condition it's on a Space. A game with fixed Hazard positions in multiple locations would probably be better with a seperate overlay, in 2017 I wrote Mini Ball Maze, which had all the information stored within the Data, though it's probably quite possible to improve on that by making it larger by storing the Maze & Hazards as seperate Binary Representation overlays.

Very cool I tried to find some information on the BIN\$ function but only saw a python reference.

What BASIC dialect is it from?

##### Share on other sites

I believe AMSDOS is a dedicated Amstrad CPC user so that would be Locomotive BASIC.

##### Share on other sites

@Carlsson is correct.

BIN\$(num,binary digits) converts an Integer value into a String consisting of 1s and 0s. The 2nd parameter which is optional will omit leading 0s for low values, though can include leading 0s upto 16 places making it useful for maze style games which can be extracted from MID\$() statements.

Its possible to use BASIC to convert a number into it's Binary equivalent, I wrote one below (which could probably be written better), though the amount of code involved would compromise a 10-Liner instead of having a function which does the job. It might be worth adding to Supercharger BASIC if possible, though if FastBASIC can have tricks of compressing DATA, then that would seem to be better than using a BIN\$ type function for storing information.

##### Share on other sites

Finished my extrem-256

##### Share on other sites

29 minutes ago, Preppie said:

Finished my extrem-256

Very nice!

##### Share on other sites

On 3/15/2022 at 6:50 AM, AMSDOS said:

@Carlsson is correct.

BIN\$(num,binary digits) converts an Integer value into a String consisting of 1s and 0s. The 2nd parameter which is optional will omit leading 0s for low values, though can include leading 0s upto 16 places making it useful for maze style games which can be extracted from MID\$() statements.

Its possible to use BASIC to convert a number into it's Binary equivalent, I wrote one below (which could probably be written better), though the amount of code involved would compromise a 10-Liner instead of having a function which does the job. It might be worth adding to Supercharger BASIC if possible, though if FastBASIC can have tricks of compressing DATA, then that would seem to be better than using a BIN\$ type function for storing information.

Great example! I added a reference to the BIN\$ function in the instructions about section for my entry:

Jupiter SS Firestorm is now online in Javatari here:

##### Share on other sites

I've sent my two latest PUR-120 games to @Bunsen. Both of them are FastBasic...

Chickens on the Freeway:

Bert:

I previously sent 1nvas0r, an EXTREM-256 game which is listed as entry #25 in the contest page:

My PUR-80 entries are standby. I'm still trying to do it better in this category, but there is less than 5 days to the deadline. Argh!

• 10
##### Share on other sites

Let me say that some of the work here is amazing - I'm blown away by the quality of content from some incredible programmers.  It's been YEARS since I did any BASIC programming (although I was never a strong coder to begin with), and this stuff blows away most of the stuff I'd key in from ANALOG or Antic Magazines.

What was the genesis of this contest?  I understand pushing the limits, but doing 10 lines in Atari BASIC?  That seems masochistic LOL!

Seriously, I'm going to start deconstructing some of this code to learn.  I'm certain I can't do what you guys can, but even to create something (it's been 30 years since I've done anything, and almost 20 years since I got my degree in Software Engineering) would be an accomplishment.

Are there any good tutorials I can reference to help?

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

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.