2k adventure

Discussion about ZX80 / ZX81 Software
Crayon21
Posts: 346
Joined: Sun Nov 04, 2018 2:33 am

Re: 2k adventure

Post by Crayon21 »

i never expected to get so much praise from what would amount to be a small achievement on any other forum. I am happy to hear all of your replies and very touched :D

Limitations breed innovation
innovation breeds great games
Games like The Hobbit
Exolon
And JetPac (thank god for Rare Replay)

And that's why I love the Sinclair machines and community, you guys are reasonable, fun and nice to have around. I think i'm going to like it here
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
Dim_75
Posts: 80
Joined: Fri Sep 01, 2017 11:04 pm
Location: Paris, FR

Re: 2k adventure

Post by Dim_75 »

Hi every body,
Just be looking the listing, i don't really understand the listing, may be it's too far from my memory ?
What the variable TREASURE is needed for ?
Why giving the TT variable the unknow value TRAP, it should'nt give an error ?
Each time you make an INPUT, there is no condition after it, you just go to the next line , may be a simple GOTO to the INPUT line (to ask another time if it's the wrong choice) is to use ?
Same logic for your differents INPUT lines.

I will try it on an emulator to be sure, but, as is ,it is quite confusing for me :?
Or i would simply go back to my COBOL and check the DATA DIVISION ? :D
Anyway in 2K it's really a challenge as you get stuck quickly !
Crayon21
Posts: 346
Joined: Sun Nov 04, 2018 2:33 am

Re: 2k adventure

Post by Crayon21 »

Dim_75 wrote: Tue Nov 20, 2018 10:53 pm Hi every body,
Just be looking the listing, i don't really understand the listing, may be it's too far from my memory ?
What the variable TREASURE is needed for ?
Why giving the TT variable the unknow value TRAP, it should'nt give an error ?
Each time you make an INPUT, there is no condition after it, you just go to the next line , may be a simple GOTO to the INPUT line (to ask another time if it's the wrong choice) is to use ?
Same logic for your differents INPUT lines.

I will try it on an emulator to be sure, but, as is ,it is quite confusing for me :?
Or i would simply go back to my COBOL and check the DATA DIVISION ? :D
Anyway in 2K it's really a challenge as you get stuck quickly !
sorry for that, I might fix it, I might not, depends
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: 2k adventure

Post by XavSnap »

sorry for that, I might fix it, I might not, depends
Sorry for that too, we might help you, we might not, depends
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Crayon21
Posts: 346
Joined: Sun Nov 04, 2018 2:33 am

Re: 2k adventure

Post by Crayon21 »

XavSnap wrote: Wed Nov 21, 2018 9:31 am
sorry for that, I might fix it, I might not, depends
Sorry for that too, we might help you, we might not, depends
i'll see what I can do
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: 2k adventure

Post by XavSnap »

Code: Select all

     1 LET R=PI/PI
     5 LET L=NOT R
    10 LET Q=NOT PI/PI
    20 PRINT ,,("YOU ARE IN A CAVE." AND R=1);(" IN THE CAVE  IS A LAMP" AND NOT L AND R=1);(" LAMP TAKEN, YOU CAN NOW SEE FURTHER." AND L=1 AND R=1);(" THE CAVE IS NOW BRIGHT AND YOU CAN SEE THE TREASURE I THE DISTANCE" AND L=1 AND R=1);("TRAP SPRUNG. YOU ARE NOW ONE LEVEL BELOW THE TREASURE." AND R=2);(" THERE IS A LAMP HERE TO REPLACE THE BROKEN ONE" AND R=2 AND NOT L);("YOU CAN GO EAST, WEST OR NORTH" AND R=3 AND L);("YOU GO NORTH AND FIND YOUR WAY  BACK.YOU HAVE TAKEN THE TREASURE,YAY" AND R=4);("YOU TAKE THE TREASURE AND HEAD  OUT OF THE CAVE" AND R=5)
    25 IF R=5 THEN STOP
    30 INPUT A$
    40 IF (R=PI/PI OR R=2) AND A$="GET LAMP" THEN LET L=PI/PI
    50 IF L AND R=1 AND A$="NORTH" THEN LET Q=PI/PI
    60 IF Q THEN LET R=2
    70 IF Q THEN LET L=NOT Q
    80 IF (L AND R=2)OR(R=3) AND A$="NORTH" THEN LET R=R+PI/PI
    100 IF R=4 AND A$="SOUTH" THEN LET R=5
    110 CLS
    120 GOTO 10
2KADV.P
(968 Bytes) Downloaded 260 times
Have fun!
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: 2k adventure

Post by mrtinb »

XavSnap wrote: Thu Nov 22, 2018 6:38 am 2KADV.P

Have fun!
Brilliant!
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
TMAOne
Posts: 212
Joined: Thu Aug 16, 2012 6:56 pm
Location: Waterloo, Ontario, Canada

Re: 2k adventure

Post by TMAOne »

I took a different approach. I'm a firm believer that programs should be bullet-proof and robust. But Adventure games are a challenge, especially when limiting oneself to 2K! So I tried for 4 rooms and 4 feature items. In the end it's more like 3K.

Anyone care to pare it down with more of that PI/PI magic?

Lines 1000 to 1100 inclusive are designed to be eliminated once the program has run once. I include them here for reference.

4K ADVENTURE.p
(2.52 KiB) Downloaded 238 times
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: 2k adventure

Post by siggi »

TMAOne wrote: Thu Nov 22, 2018 7:55 am Anyone care to pare it down with more of that PI/PI magic?
You could save a lot of bytes by replacing numeric constants to VAL: 1 -> VAL"1" and by using variable assignments for equal values;
LET a=1
LET b=1

- >
LET a=VAL"1"
LET b=a

See
viewtopic.php?f=5&t=85&start=20#p25920

HTH Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
TMAOne
Posts: 212
Joined: Thu Aug 16, 2012 6:56 pm
Location: Waterloo, Ontario, Canada

Re: 2k adventure

Post by TMAOne »

I started my program on a "Sinclair Diet", but I don't think I'm going to make the 2K finish line without some major loss of functionality, which I'm reluctant to do. :cry: So. I have failed The Challenge. "This school is about combat gentlemen. There are no points for second place." :lol:

3KADV.p
(2.16 KiB) Downloaded 226 times

Here's one written by a friend of mine, but for the "full" 16K machine.

ADVENTUR.P
(10.86 KiB) Downloaded 231 times
Last edited by TMAOne on Fri Nov 23, 2018 12:09 am, edited 1 time in total.
Post Reply