Full circle..

15 views
Skip to first unread message

The Beez

unread,
Apr 30, 2025, 9:34:34 AMApr 30
to 4tH-compiler
Hi 4tH-ers!

Back in 1997, when I first put out 4tH because I got tired of emailing copies, I thought the project needed two things to release it to the public:
- An editor (because I had this wild idea Forth needed an editor);
- And a flagship program.

Well, the first one I ripped from FIG (and it still serves well after 30 years) - and the second one was a small adventure game I found as a "type in" in a ZX Spectrum mag. VENTURE.

You can really see here hoe my Forth style changed:

: do-wear                              \ wear helmet
  objects decode
  if                                   \ do we want to wear a helmet?
    object@ helmet <> if CANNOT exit then

    helmet missing?                    \ do we have a helmet?
    if MISSING exit then

    helmet? done!                      \ now put on the helmet
  else
    IDUNNO
  then
;


I'd probably write it nowadays as:

: do-wear
  objects decode if
    object@ helmet = unless CANNOT ;then
    helmet missing? if MISSING ;then helmet? done!
  ;then IDUNNO
;

But I digress. Anyways, the program is still there after 30 years. In the meanwhile I've used it as a test bed for lots of things, including uBasic/4tH - but that version was a complete rewrite because that interpreter wasn't that capable yet. Like having no strings ;-)

I've watched quite some ZX Spectrum shows on YT lately and I came to realize that uBasic/4tH is not just a match for ZX BASIC - it surpasses it. So this morning I thought, "Why not give it a try?" 

Yeah, there were some long variable names, but those were easily replaced. Also - lots of DATA statements, but unless they are very long, I can handle those. Of course, lots of subtle and less subtle bugs had to be squashed, but that's just a matter of patience. It ran. 

Now, I've tried to stay as close to the original source as possible. Of course, I had to deal with screen effects and sounds - I had to remove those. I sacrificed an array element to get rid of the 1-numbered ZX BASIC arrays. I also fixed a bug in the original source.

So what's included is the best translation from ZX BASIC to uBasic/4tH I can make. This is the place I started from. Enjoy!

Hans Bezemer
zxventur.bas

The Beez

unread,
May 1, 2025, 7:09:06 AMMay 1
to 4tH-compiler
Ok, make of it what you want, but I gathered some aspects of this adventure on the ZX Spectrum could be replicated by ANSI terminal codes - which are supported by uBasic/4tH using the "\e" escape codes.
So I fiddled a bit to get 'em in, taking care I use the most conservative ANSI standard possible and it worked!

Here a screenshot of the Spectrum and the uBasic/4tH screen. Note "COMMAND EXECUTED" is flashing on both systems.
I added this version as "ANSIVENT.BAS". Sure, you need a white screen with black text to complete the imitation - which I did for your folks! Now back to green..

Yeah, last attachment for now. I'm done - after adding some additional text and fixing another bug.

Hans Bezemer
Venture16.png
Reply all
Reply to author
Forward
0 new messages