Gauntlet - in ten lines of BASIC, apparently

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
Post Reply
User avatar
PeteProdge
Bugaboo
Posts: 3697
Joined: Mon Nov 13, 2017 9:03 am

Gauntlet - in ten lines of BASIC, apparently

Post by PeteProdge »

Not one of mine (ah, one day I'll put out something), but here's Micro Gauntlet from 'Ivan Basic' on the ZX Spectrum, which is a heavily cut-down version (obviously) of Atari's combat maze classic - but look at it!..

https://twitter.com/_IvanBasic_/status/ ... 6467418112

It's been entered at part of the 10 Liner BASIC Contest 2021.

Instructions and a tech explanation from the author here. You control just the Elf, he can't shoot, the dungeons are much smaller... but, hey, this is with the self-imposed limitation of 10 LINES OF BASIC, which is absolutely astonishing!

4,635 bytes gets you a compact yet playable version of Gauntlet, so very much punching above its weight. I'm stunned this was done in those parameters. It's got the feel of those Grandstand handheld electronic games, yet a lot better.

Download the TAP here...

https://twitter.com/_IvanBasic_/status/ ... 0676129797
Reheated Pixels - a combination of retrogaming, comedy and factual musing, is here!
New video: Nine ZX Spectrum magazine controversies - How Crash, Your Sinclair and Sinclair User managed to offend the world!
SteveSmith
Manic Miner
Posts: 760
Joined: Mon Nov 26, 2018 1:07 pm
Location: UK
Contact:

Re: Gauntlet - in ten lines of BASIC, apparently

Post by SteveSmith »

Is there a straight listing anywhere? Loads of explanation, but only a tap file (okay, and I'm too lazy to open it). It looks really good though.
Last edited by SteveSmith on Tue Feb 23, 2021 9:37 am, edited 1 time in total.
Sparky
Manic Miner
Posts: 611
Joined: Tue Dec 15, 2020 9:42 pm

Re: Gauntlet - in ten lines of BASIC, apparently

Post by Sparky »

Outstanding!
Alex
User avatar
Hedge1970
Manic Miner
Posts: 388
Joined: Mon Feb 18, 2019 2:41 pm

Re: Gauntlet - in ten lines of BASIC, apparently

Post by Hedge1970 »

Wow, I had no idea, this could be done. Loaded and ran on my speccy. Will look at this in more detail over the week.
User avatar
Nitrowing
Manic Miner
Posts: 632
Joined: Mon Sep 21, 2020 8:38 pm
Location: Cleethorpes

Re: Gauntlet - in ten lines of BASIC, apparently

Post by Nitrowing »

Considering the hours I spent typing in code from magazines, I'm stunned at this :shock:
User avatar
Turtle_Quality
Manic Miner
Posts: 511
Joined: Fri Dec 07, 2018 10:19 pm

Re: Gauntlet - in ten lines of BASIC, apparently

Post by Turtle_Quality »

Here it is after dumping the listing from Basinc, not sure what the line 3500 is there for

Code: Select all


   1 POKE 23561,5: POKE 23693,4: BORDER 0: CLEAR 65367: RESTORE 10: PRINT AT 15,19;"___Micro";AT 16,19;"Gauntlet";AT 10,20;"\{i7}PRESS";AT 11,20;"START": READ y,x,c,g,h,s,t,m,o,p,t,u,z,f,w,a,b,e,k,q: DIM a(20,3): FOR a=65368 TO 65471: READ b: POKE a,b: NEXT a: PAUSE 0: BEEP .06,40: BEEP .06,43: BEEP .2,48: PRINT AT 5,19;"\{vi}   Elf  \{vn}";AT 7,20;"HEALTH";AT 13,19;"STAGE";AT 10,20;"\{i6}\g x 1\{i4}";AT 11,20;"\{i1b1}\m x 1"
   2 PRINT AT 10,8;"\{i7}STAGE ";e: LET p$=CHR$ 22+CHR$ (RND*8+6)+CHR$ (RND*8+7)+"\{i1}\m": LET b=INT (RND*6)+1: LET u=VAL "001012"(b): FOR a=1 TO 3: LET p$=p$+CHR$ 22+CHR$ (RND*8+6)+CHR$ (RND*8+7)+"\{i6}\g": NEXT a: LET p$=p$+CHR$ 16+CHR$ u+CHR$ 17+CHR$ b+CHR$ 22+CHR$ 5+CHR$ 5+"\e\e\e\e\e\e\e\e\e\e\e\e\e"+CHR$ 22+CHR$ 16+CHR$ 5+"\e\e\e\e\e\e\e\e\e\e\e\e\e"+CHR$ 22+CHR$ 5+CHR$ (RND*10+6)+"\{p0i7}\h": FOR a=6 TO 15: LET p$=p$+CHR$ 16+CHR$ u+CHR$ 17+CHR$ b+CHR$ 22+CHR$ a+CHR$ 5+"\e"+CHR$ 22+CHR$ a+CHR$ 17+"\e"+CHR$ 22+CHR$ (RND*7+7)+CHR$ (RND*10+5)+"\e \e"+CHR$ 8+CHR$ 8+"\{p0i5}\f": NEXT a: PRINT AT 10,8,p$;AT 15,16;"\{i4}\j";AT 13,25;e
   3 RESTORE 3: READ u,f,y,x,d,p$: FOR a=6 TO 12 STEP 2: FOR b=7 TO 15 STEP 2: LET a(d,1)=a: LET a(d,2)=b: LET a(d,3)=ATTR (a,b)=4: LET p$=p$+CHR$ 22+CHR$ a+CHR$ b+("\{i7b1}\d" AND a(d,3)): LET d=d+1: NEXT b: NEXT a: PRINT p$: POKE 23560,0: LET p$="": DATA b*8+u,0,15,16,1,""
   4 LET f=f+1 AND f<19: LET c=f+1: IF a(c,3) THEN LET g=a(c,1): LET i=g: LET h=a(c,2): LET j=h: LET v=(g<y)-(g>y): LET g=g+(v AND ATTR (g+v,h)=4): LET l=(h<x)-(h>x): LET h=h+(l AND ATTR (g,h+l)=4): PRINT AT i,j;" " AND a(c,3);AT g,h; INK 7; BRIGHT 1;"\c\b\c\d\a"(3+l+v) AND a(c,3): LET a(c,1)=g: LET a(c,2)=h: IF g=y THEN IF h=x THEN PRINT AT y,x;"\{b1i7i7}\i": LET z=z-20: BEEP .1,-20: LET a(c,3)=0: PRINT AT y,x;"\i": IF z<0 THEN LET w=71: GO TO 8
   5 LET z=z-1: LET s=y: LET t=x: LET m=PEEK 23560: LET p=(m=112)-(m=111): LET x=x+(p AND ATTR (y,x+p)<>u): LET o=(m=97)-(m=113): LET y=y+(o AND ATTR (y+o,x)<>u): LET w=ATTR (y,x): IF w=5 THEN LET y=(s AND NOT k)+(y AND k): LET x=(t AND NOT k)+(x AND k): BEEP .05 AND k,45: LET k=k-1 AND k
   6 IF m=109 THEN LET q$="": FOR a=1 TO 20 AND q: PRINT AT y,x; OVER 1;"\{i7b1} ": LET q$=q$+CHR$ 22+CHR$ a(a,1)+CHR$ a(a,2)+(" " AND a(a,3)): LET a(a,1)=15: LET a(a,2)=6: PRINT OVER 1;AT y,x;"\{b1i1} ": NEXT a: BORDER 7 AND q: LET a=.005 AND q: LET q=q-1 AND q: BEEP .02,-8: BEEP a+a,-4: BEEP a,0: BEEP a,0: PRINT q$;AT y,x; OVER 1;"\{i4} ": POKE 23560,0: BORDER 0: GO TO 10
   7 PRINT AT 8,22;z,AT s,t;" " AND ((s-y)+(t-x));AT y,x;"\j \i"(p+2) AND p;"\k \l"(o+2) AND o: POKE 23560 AND (o+p),0: IF z<1 THEN LET w=71
   8 IF w=71 THEN BEEP .1,-20: FOR a=1 TO 20: PRINT AT y,x; OVER 1;"\{i7b1} ": LET a(a,3)=a(a,3)-(y=a(a,1) AND x=a(a,2)): PRINT OVER 1;AT y,x;" ": NEXT a: LET z=z-50: IF z<0 THEN PRINT AT 8,22;"0 ": BEEP .2,-26: BEEP .2,-30: BEEP .5,-38: LET b=0: FOR a=1 TO 15: LET b=7-b AND b=0: PRINT AT 10,7; INK b;"GAME OVER";AT 13,25;e: FOR c=1 TO 10+b*5: NEXT c: NEXT a: RUN
   9 IF w=7 THEN FOR a=10 TO 1 STEP -1: PRINT AT 5,x;"\l\i\k\j\l\i\k\j\l\i"(a): BEEP .05,-30+3*a: NEXT a: PRINT AT 5,x;"\{p0i7}\h": LET p$="": FOR a=5 TO 16: LET p$=p$+CHR$ 22+CHR$ a+CHR$ 5+CHR$ 23+CHR$ 18+CHR$ 0: NEXT a: LET e=e+1: PRINT p$: GO TO 2
  10 LET k=k+(w=6): LET q=q+(w=1): PRINT AT 10,24; INK 6;k,AT 11,24; INK 1;q,: GO TO 4: DATA 1,y,y,y,y,y,y,y,y,y,y,y,999,y,y,y,y,y,y,y,7,8,14,30,254,124,15,0,224,16,112,120,127,62,240,0,65,93,125,126,56,48,48,16,8,12,12,28,126,190,186,130,129,66,61,38,37,62,85,171,0,127,129,255,255,255,254,0,0,2,5,125,85,82,0,0,0,106,68,100,74,106,0,0,228,114,115,15,121,58,108,70,39,78,206,240,158,92,54,98,56,117,147,30,108,238,235,128,1,215,119,54,120,201,174,28,0,60,24,24,44,94,94,60
3500 LET z=z-1: LET s=y: LET t=x: LET m=PEEK 23560: LET p=(m=112)-(m=111): LET x=x+(p AND ATTR (y,x+p)<>u): LET o=(m=97)-(m=113): LET y=y+(o AND ATTR (y+o,x)<>u): LET w=ATTR (y,x): IF w=5 THEN LET y=(s AND NOT k)+(y AND k): LET x=(t AND NOT k)+(x AND k): BEEP .05 AND k,45: LET k=k-1 AND k
Definition of loop : see loop
User avatar
Juan F. Ramirez
Bugaboo
Posts: 5176
Joined: Tue Nov 14, 2017 6:55 am
Location: Málaga, Spain

Re: Gauntlet - in ten lines of BASIC, apparently

Post by Juan F. Ramirez »

That contest is just amazing. Here another competitor:

https://twitter.com/AvlixA/status/13628 ... 55681?s=19
User avatar
patters
Manic Miner
Posts: 483
Joined: Thu Apr 11, 2019 1:06 am

Re: Gauntlet - in ten lines of BASIC, apparently

Post by patters »

Great work [mention]IvanBasic[/mention], Micro Gauntlet is amazing! The presentation is so neat, and it even has nice little sounds as well. That must have taken a very long time to create and optimise.
User avatar
patters
Manic Miner
Posts: 483
Joined: Thu Apr 11, 2019 1:06 am

Re: Gauntlet - in ten lines of BASIC, apparently

Post by patters »

Here is the BASIN dump which [mention]Turtle_Quality[/mention] posted above, run through my syntax highlighter for ZX BASIC, and line-wrapped for a bit more readability.
Line 3500 was in fact a duplicate of line 5 so presumably that was an error.

Image

BASIN exports some escaped character sequences which ZX BASIC doesn't support, like \{vi} and concatenating multiple escapes into a single set of braces e.g. \{b1i7i7}. String contents should be green, escaped characters should be purple.
Last edited by patters on Thu Feb 25, 2021 12:54 am, edited 5 times in total.
Alcoholics Anonymous
Microbot
Posts: 194
Joined: Mon Oct 08, 2018 3:36 am

Re: Gauntlet - in ten lines of BASIC, apparently

Post by Alcoholics Anonymous »

That's fantastic lol.
User avatar
IvanBasic
Drutt
Posts: 48
Joined: Mon May 13, 2019 1:24 pm

Re: Gauntlet - in ten lines of BASIC, apparently

Post by IvanBasic »

Turtle_Quality wrote: Tue Feb 23, 2021 5:19 pm Here it is after dumping the listing from Basinc, not sure what the line 3500 is there for
Ooppps, line 3500 remained unerased after doing a renum... Hope this mistake does not put me out of contest for having over 10 lines...
User avatar
IvanBasic
Drutt
Posts: 48
Joined: Mon May 13, 2019 1:24 pm

Re: Gauntlet - in ten lines of BASIC, apparently

Post by IvanBasic »

patters wrote: Wed Feb 24, 2021 8:41 pm Great work @IvanBasic, Micro Gauntlet is amazing! The presentation is so neat, and it even has nice little sounds as well. That must have taken a very long time to create and optimise.
Thanks @Patters, in fact the seed was that 1-liner with penguins moving I did, so I had to add the layout generation, and the magic potion code, that's all.

I couldn't manage a shooting routine in 1 just 1 line, but the potion I think saved the playbility.
Post Reply