Page 2 of 3
Re: 2k adventure
Posted: Tue Nov 20, 2018 7:56 pm
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
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
Re: 2k adventure
Posted: Tue Nov 20, 2018 10:53 pm
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 ?
Anyway in 2K it's really a challenge as you get stuck quickly !
Re: 2k adventure
Posted: Wed Nov 21, 2018 7:42 am
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 ?
Anyway in 2K it's really a challenge as you get stuck quickly !
sorry for that, I might fix it, I might not, depends
Re: 2k adventure
Posted: Wed Nov 21, 2018 9:31 am
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
Re: 2k adventure
Posted: Wed Nov 21, 2018 8:51 pm
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
Re: 2k adventure
Posted: Thu Nov 22, 2018 6:38 am
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 262 times
Have fun!
Re: 2k adventure
Posted: Thu Nov 22, 2018 7:25 am
by mrtinb
XavSnap wrote: ↑Thu Nov 22, 2018 6:38 am
2KADV.P
Have fun!
Brilliant!
Re: 2k adventure
Posted: Thu Nov 22, 2018 7:55 am
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.
Re: 2k adventure
Posted: Thu Nov 22, 2018 1:59 pm
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
Re: 2k adventure
Posted: Thu Nov 22, 2018 8:03 pm
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.
So. I have failed The Challenge.
"This school is about combat gentlemen. There are no points for second place."
- 3KADV.p
- (2.16 KiB) Downloaded 229 times
Here's one written by a friend of mine, but for the "full" 16K machine.