Expanding the range of QL Adventures

Anything QL Software or Programming Related.
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Expanding the range of QL Adventures

Post by tofro »

Cristian wrote:100 DEFine PROCedure doSomething(dng)
110 some calculations
120 IF done THEN EXIT doSomething
130 do some more
140 END DEFine doSomething

You should utilize EXIT and place the END DEFine at the very end of the procedure.
And thanks for your nice game!
No you shouldn't. EXIT (at least on SBASIC) will only work to exit from loops (REPeat, FOR). Your way of doing things produces an "undefined loop variable" error in SBASIC. The Turbo compiler will also choke on this line. SuperBASIC with its sloppy syntax check might probably accept this, I can't test at the moment.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
georgeo
Bent Pin Expansion Port
Posts: 95
Joined: Wed Aug 03, 2016 8:49 am

Re: Expanding the range of QL Adventures

Post by georgeo »

Hi everyone,

A quick look at Jan Jones' book suggests that I should use RETURN if I want to exit a procedure before the end, which is what I have mostly done--except for the typo, which is probably what Martyn was referring to.

Thanks for your help,
George.


User avatar
Cristian
Aurora
Posts: 960
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Expanding the range of QL Adventures

Post by Cristian »

tofro wrote:
No you shouldn't. EXIT (at least on SBASIC) will only work to exit from loops (REPeat, FOR). Your way of doing things produces an "undefined loop variable" error in SBASIC. The Turbo compiler will also choke on this line. SuperBASIC with its sloppy syntax check might probably accept this, I can't test at the moment.

Tobias

Yes you're absolutely right Tobias, and thank you very much for your correction! Sorry! Never try to write code with a headache... I should take a pill and keep my hands far from the keyboard!


georgeo
Bent Pin Expansion Port
Posts: 95
Joined: Wed Aug 03, 2016 8:49 am

Re: Expanding the range of QL Adventures

Post by georgeo »

Modest updates to Akalabeth: World of Doom. Player now receives reward (hit points) when leaving dungeon and the special attacks for thief and gremlin are implemented--thief special attack is particularly annoying as they keep stealing your weapons! Try it out from:

https://github.com/SinclairQL/akalabeth

Hopefully find time to do more over coming weeks,
Georgeo.


User avatar
XorA
Site Admin
Posts: 1358
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Expanding the range of QL Adventures

Post by XorA »

I don't think this set of adventures have been done for QL yet (I could not find them on Dilwyn's page).

The ScottAdams (not that one) adventure set and the ScottFree interpretor ported to QDOS.

to run

Code: Select all

DATA_USE SFA1_
ex sfa1_ScottZX
They type game number at prompt, 00-13 work normally, 14+ I wasnt quite sure of the mapping so its up to the reader to rename them to advXX_dat

For more information see :-
http://www.ifarchive.org/indexes/if-arc ... tfree.html
http://www.ifarchive.org/indexes/if-arc ... tfree.html
ScottZX.zip
(126.84 KiB) Downloaded 152 times


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Expanding the range of QL Adventures

Post by Derek_Stewart »

Hi,

I have been looking at the C source to the Scottfree Interpreter. Which is a single C file, with all the functions before the main() function.

A little sloppy, but like txtElite I ported, a single C file, but worked.

Do you think it worth making the Scottfree interpreter into individual functipn files and use Make to perform the compiling?


Regards,

Derek
Itimpi
ROM Dongle
Posts: 3
Joined: Sat Sep 02, 2017 4:56 pm

Re: Expanding the range of QL Adventures

Post by Itimpi »

I have been looking at the C source to the Scottfree Interpreter. Which is a single C file, with all the functions before the main() function.
That is the way that I think most C programs are written. When writing C avoiding forward references in the source can mean less needs pre-declaring in header files.
Do you think it worth making the Scottfree interpreter into individual function files and use Make to perform the compiling?
why do you want to do this? It is likely to lead to less efficient code as the compiler can do less optimisation of the generated code. The normal reason for breaking a file into separate files is so that you can only include the ones you want.


User avatar
XorA
Site Admin
Posts: 1358
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Expanding the range of QL Adventures

Post by XorA »

A small (probably mostly not user visible) update to Wander adventure engine.
Wander102.zip
(95.75 KiB) Downloaded 71 times


Post Reply