Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:07 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : bug in latest firmware release?

Author Message
johngill
Newbie

Joined: 22/09/2020
Location: United Kingdom
Posts: 38
Posted: 11:38am 26 Nov 2020
Copy link to clipboard 
Print this post

Hi all,

I'm currently running on CMM2V5.06.00b4 and I'm tinkering with a bit of a text-adventure interpreter so I can write my own text adventures (drawing rather heavily on ZIL)

If you type the following line as a program:

exit$="(EAST TO KITCHEN)(WEST TO STRANGE_PASSAGE IF CYCLOPS_FLED ELSE 'sorry but the wooden door is nailed shut.')"

and run it, you get this:

Error in line 1: No DO loop is in effect

This must be a firmware bug yes?


John
 
johngill
Newbie

Joined: 22/09/2020
Location: United Kingdom
Posts: 38
Posted: 11:41am 26 Nov 2020
Copy link to clipboard 
Print this post

_update_

apologies, I've only just noticed that the latest firmware is B6!!

Downloading now
 
johngill
Newbie

Joined: 22/09/2020
Location: United Kingdom
Posts: 38
Posted: 11:47am 26 Nov 2020
Copy link to clipboard 
Print this post

_update_

B6 firmware installed, this error is still displayed.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 11:47am 26 Nov 2020
Copy link to clipboard 
Print this post

  johngill said  ... I'm tinkering with a bit of a text-adventure interpreter so I can write my own text adventures (drawing rather heavily on ZIL) ...


Hi John,

Are you writing an "interpreter" ? or are you writing a "compiler" ? As I understand it ZIL (Zork Implementation Language) is a Lisp like language that was complied to Z-machine code.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 11:50am 26 Nov 2020
Copy link to clipboard 
Print this post

Your issue goes away if you put DIM infront of it, but I agree it otherwise looks like a bug.

I really recommend starting your MMBasic programs with OPTION EXPLICIT ON, explicit variable declaration will save you from so many bugs later on.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 12:30pm 26 Nov 2020
Copy link to clipboard 
Print this post

exit is a reserved word and when it appears as the first thing in the line it is interpreted as a command
Edited 2020-11-26 22:38 by matherp
 
johngill
Newbie

Joined: 22/09/2020
Location: United Kingdom
Posts: 38
Posted: 12:46pm 26 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  exit is a reserved word and when it appears as the first thing in the line it is interpreted as a command


ah! many thanks, it's just me being a numpty then :-D
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:01pm 26 Nov 2020
Copy link to clipboard 
Print this post

  johngill said  ah! many thanks, it's just me being a numpty then :-D


I wouldn't have said that, it's the interpreter not being as friendly as it could be ... possibly a legacy of compromises made both for performance and in order to fit it into the flash on the earlier/smaller 'mites.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
johngill
Newbie

Joined: 22/09/2020
Location: United Kingdom
Posts: 38
Posted: 01:09pm 26 Nov 2020
Copy link to clipboard 
Print this post

  thwill said  
  johngill said  ... I'm tinkering with a bit of a text-adventure interpreter so I can write my own text adventures (drawing rather heavily on ZIL) ...


Hi John,

Are you writing an "interpreter" ? or are you writing a "compiler" ? As I understand it ZIL (Zork Implementation Language) is a Lisp like language that was complied to Z-machine code.

Best wishes,

Tom


Hi Tom,

I already have your excellent zmim (along with colossal cave and zork I to keep me going... ;-) fantastic job- thanks for that!

Yes, I want to be able to write my own adventures in something approximating ZIL. I'm more of a "hobbyist" coder, this won't be a full-on implementation of ZIL, just my simplified version, running the entire adventure from just one ZILish text file.

eg,

<ROOM LIVING_ROOM
 (DESC... etc etc.)
 (ACTION.... >
<OBJECT LAMP
 (FDESC.... etc etc..)
 (ACTION...>
(VERB TAKE
 (SYNONYM.... etc etc)>

In fact I think I'm going to call it ZILish. ;-)

But rather than writing this as a compiler to convert the zil into z code to run on zmim, I want to write it as an interpreter, so I can run the source text file directly.

I've already got the parser to extract a verb, direct object and indirect object from the player's input. It's keeping me entertained anyway!

thanks

John
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:12pm 26 Nov 2020
Copy link to clipboard 
Print this post

  johngill said  I already have your excellent zmim (along with colossal cave and zork I to keep me going... ;-) fantastic job- thanks for that!


Thank you.

  Quote  But rather than writing this as a compiler to convert the zil into z code to run on zmim, I want to write it as an interpreter, so I can run the source text file directly.


Sounds cool, good luck with it.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 01:48pm 26 Nov 2020
Copy link to clipboard 
Print this post

deleted
Edited 2020-11-26 23:49 by CaptainBoing
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025