RetroBASIC

Basicprogramming(.org) => Community news and announcements => Topic started by: Richly on January 24, 2016, 10:17:11 pm

Title: BASIC Tenliners 2016
Post by: Richly on January 24, 2016, 10:17:11 pm
Here is an interesting thread from the World of Spectrum site for those of you interested in retro BASICs and have the time and inclination to take part:

http://www.worldofspectrum.org/forums/discussion/51994/basic-tenliners-2016#latest (http://www.worldofspectrum.org/forums/discussion/51994/basic-tenliners-2016#latest)

In summary, it is a competition to code a game in 10 lines of any 8-bit / retro (line based) BASIC (I think that SpecBAS would still qualify).

The rules are a little bit vague...but I thought it might be of interest to some here (after all, it is the Retrogamecoding and Basicprogramming Forum   ;))
Title: Re: BASIC Tenliners 2016
Post by: ZXDunny on January 24, 2016, 10:42:23 pm
I've asked for clarification on the architecture rule - if it's only 8bits then it's not gonna allow SpecBAS :(

Just think what I could do in ten lines... :D

D.
Title: Re: BASIC Tenliners 2016
Post by: Richly on January 24, 2016, 11:28:48 pm
I've asked for clarification on the architecture rule - if it's only 8bits then it's not gonna allow SpecBAS :(

Just think what I could do in ten lines... :D

D.

I have seen what you can do in one line, let alone ten lines!!  :)
Title: Re: BASIC Tenliners 2016
Post by: ScriptBasic on January 25, 2016, 01:02:31 am
It's statements, not lines.

Have you ever looked at the one line of code that makes jQuery?

@Paul - It seems strange that you're a line number advocate but create programs with one / two lines that take more time to understand than rewrite.
Title: Re: BASIC Tenliners 2016
Post by: B+ on January 25, 2016, 06:37:50 pm
...

@Paul - It seems strange that you're a line number advocate but create programs with one / two lines that take more time to understand than rewrite.

I have noticed this too, so I have to smile. Hey if it's a problem, maybe we can find a Basic solution.
Title: Re: BASIC Tenliners 2016
Post by: Tomaaz on January 25, 2016, 06:43:56 pm
@Paul - It seems strange that you're a line number advocate but create programs with one / two lines that take more time to understand than rewrite.

Wasn't it something about the speed?
Title: Re: BASIC Tenliners 2016
Post by: ZXDunny on January 25, 2016, 08:13:34 pm
@Paul - It seems strange that you're a line number advocate but create programs with one / two lines that take more time to understand than rewrite.

Wasn't it something about the speed?

That's part of it, certainly - executing from the same space is always going to be a mite faster than pulling lines out, at least in my interpreter.

Aside from that, it's just one of the things I like to do. Anyone who has to ask why I do it and advocate the use of line numbers really doesn't understand the question!

D.
Title: Re: BASIC Tenliners 2016
Post by: ScriptBasic on January 25, 2016, 08:53:50 pm
Quote
Aside from that, it's just one of the things I like to do. Anyone who has to ask why I do it and advocate the use of line numbers really doesn't understand the question!

This forum is about helping folks learn BASIC. Not a constant pissing match between you and JJ.

Title: Re: BASIC Tenliners 2016
Post by: Aurel on January 25, 2016, 10:22:54 pm
Quote
executing from the same space is always going to be a mite faster than pulling lines out, at least in my interpreter
that is true...and one of reason why bytecode stream is faster in execution than line by line
uff i think that oi must do something about that.... ::)
Title: Re: BASIC Tenliners 2016
Post by: ScriptBasic on January 25, 2016, 10:46:56 pm
If you want speed, use a compiler.

The point of an interpreter is ease of use, no startup costs and relaxed type / variable definitions.

There are plenty of options out there so no need for attitude here on the forum.

Title: Re: BASIC Tenliners 2016
Post by: ZXDunny on January 25, 2016, 11:19:50 pm
Quote
executing from the same space is always going to be a mite faster than pulling lines out, at least in my interpreter
that is true...and one of reason why bytecode stream is faster in execution than line by line
uff i think that oi must do something about that.... ::)

SpecBAS is a hybrid system, I think. The bytecode is all in one large memory block, but there's certain housekeeping that has to be done between lines that isn't necessary between statements, and GO TO has to perform a lookup to get the address of the line to jump to. It's that housekeeping that can slow things down, but it's not by much - it's still plenty fast enough.

At least it is until I get the compiler finished :)

D.
Title: Re: BASIC Tenliners 2016
Post by: B+ on January 26, 2016, 02:48:45 am
Hi D,

I was pleasantly surprised with what was in latest download today.
Title: Re: BASIC Tenliners 2016
Post by: ZXDunny on January 26, 2016, 09:54:46 am
I was pleasantly surprised with what was in latest download today.

Glad to hear it - any suggestions and bug reports are welcome :)

D.
Title: Re: BASIC Tenliners 2016
Post by: Richly on February 06, 2016, 10:16:03 pm
22 entries so far...including one for the Sinclair ZX81
Title: Re: BASIC Tenliners 2016
Post by: Richly on April 08, 2016, 10:47:56 pm
...and here are the results:

http://gkanold.wix.com/homeputerium#!results-2016/c1snz
Title: re: Ten Liners Winners
Post by: B+ on April 09, 2016, 03:32:05 pm
Hi Richey,

Which was your favorite 10 liner?

For me, they won't show code, I suppose I'd have to join but first I'd have to learn to speak the language...

Anyway, for 10 lines, you'd think they'd have room to show the code unless not(?) public code.

IF NOT public code, THEN NOT really in spirit of BASIC.
Title: Re: BASIC Tenliners 2016
Post by: Mr SQL on April 09, 2016, 08:04:21 pm
The promoters show screenshots with code links you can run in the respective emulators:
http://gkanold.wix.com/homeputerium#!games-list-2016/c1jdt

My entry was 9LineBlitz for the Atari 2600 written in Virtual World Tiny BASIC, here's the 9 lines of code to discuss; placed pretty well, maybe could have placed higher if I used that extra line :) Was fun to compete like bitd!

0 data city 1,4,2,5,3,2,3,1,4,1,1,1,5,2,2,3,1,4,1,4,3,1,4,4,1,1,2,2,3,1,3,4,5,4,4,3,4,5,1,2,4,1,5,2,2,3,1,3,1,1,4,1
1 if g=0 then for j=0 to 7:player1(j)=189:player0(j)=pl(j):next j:BYTErowoffset=120:COLUPF=$84:COLUP0=$b4 else goto 3
2 for j=20 to 71:k=j-20:k=city(k)+14:for i=k to 19:vwpixel(j,i,on):next i,j:player0y=88:player0x=94:COLUP1=$74:y=20
3 COLUBK=0:AUDV0=0:g=1:scrollvirtualworldtoggle=1:BITIndex=BITIndex+1:data pl 0,224,127,231,252,192,128,0:rem bitmap
4 if joy0fire=1 and y>=20 then AUDF0=6:AUDC0=8:AUDV0=15:x=BITIndex+11:y=11:i=88-player0y:i=i/10:y=y+i
5 if y<21 then vwpixel(x,y,bindplayer1):j=y-10:y=y+1:COLUP1=M(j):data M $64,$54,$b4,$a4,$32,$44,$24,$c4,$94,$f4,$54
6 if y<=19 and vwpixel(x,y,poll)>0 then vwpixel(x,y,flip):player1x=0:player1y=0:AUDC0=y:y=20:AUDF0=4:AUDV0=15
7 if BITIndex>71 then BITIndex=0:player0y=player0y-2:rem player flies lower each pass over the smoothly scrolling city
8 if CXP0FB>126 then CXCLR=0:g=0:for i=0 to 255:AUDF0=i:AUDV0=i:COLUBK=$34:next i:rem check collision, restart game


Here's what's going on in the BASIC:

Lines 1 and 2 are setup routines and use a couple of for next loops to draw a city on the large virtual world and to load a player sprite with a bitmap, reading the data from named arrays.

The rest of the program uses the blitter commands and objects surfaced to the BASIC to smoothly scroll the virtual world at 30 frames per second of full screen animation while floating the player sprite and tile mapping it's flashing disco missiles by binding them to the scrolling background at 30 FPS while they are falling at a slower speed with the Y axis unbound (but also 30 FPS) for a neat visual effect; these are all features of the soft blitter chip in the runtime (tile mapping, flipping and sliding the entire display around while all of the sprites and playfield graphics are also moving relative to themselves).
 
Title: Re: re: Ten Liners Winners
Post by: Richly on April 10, 2016, 01:00:39 pm
Hi Richey,

Which was your favorite 10 liner?

For me, they won't show code, I suppose I'd have to join but first I'd have to learn to speak the language...

Anyway, for 10 lines, you'd think they'd have room to show the code unless not(?) public code.

IF NOT public code, THEN NOT really in spirit of BASIC.

Ah well, I'm biased towards the Spectrum entries  :) but I was pretty taken with the ZX81 entry too.

You can download the listings via Dropbox, although you will have to create an account if you don't have one.
Title: Re: BASIC Tenliners 2016
Post by: B+ on April 11, 2016, 06:52:59 pm
Thanks Mr SQL and Richey!

Mr SQL, your code example is eye opener for me. Many questions but one mainly $number is... ???

I hope not one person tells those guys that their code and screen shots would be most welcome here, by me at least, because I know those guys don't like to show off or anything like that!  ;)
Title: Re: BASIC Tenliners 2016
Post by: Mr SQL on April 12, 2016, 08:07:36 am
Thanks Mr SQL and Richey!

Mr SQL, your code example is eye opener for me. Many questions but one mainly $number is... ???

I hope not one person tells those guys that their code and screen shots would be most welcome here, by me at least, because I know those guys don't like to show off or anything like that!  ;)
;D Mostly the C64 programmers are talking about it on Lemon and the Atari programmers on AtariAge, not sure where the ZX81 and speccy programmers forums are, doubtless some pretty cool programming discussions there too! 

I will tell them about the Retrogamecoding and Basicprogramming forum, great place for us all to discuss! :)

The $ is a hexadecimal prefix, $FF like &HFF. I used it for color assignments because the NTSC color chart I referenced didn't show decimal, I prefer decimal.

I had initially used a binary prefix %10111101 instead of 189 to draw the disco missile (you can see the pattern in the pic) and for the bitmap for the ship, but converted them to decimal to meet the contests line length limits.
Title: Re: BASIC Tenliners 2016
Post by: Mr SQL on April 18, 2016, 12:22:42 pm
There's an awesome video of the Atari BASIC game entries here with great commentary, hope to see vids for the TRS-80 and other systems:

https://www.youtube.com/watch?v=Ke7WZXwg6_M

These 10 line homebrews are amazing to see in action and perform like machine language games thanks to the advanced graphics and sound accelerator chips in the Atari 8-bit computers.