Expanding the range of QL Adventures

Anything QL Software or Programming Related.
User avatar
tofro
QL Wafer Drive
Posts: 1640
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Expanding the range of QL Adventures

Postby tofro » Thu Jan 25, 2018 9:59 am

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

Postby georgeo » Thu Jan 25, 2018 2:03 pm

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
Super Gold Card
Posts: 641
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Expanding the range of QL Adventures

Postby Cristian » Thu Jan 25, 2018 7:43 pm

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

Postby georgeo » Sun Aug 12, 2018 9:24 pm

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
Super Gold Card
Posts: 593
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Expanding the range of QL Adventures

Postby XorA » Tue May 07, 2019 9:40 pm

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 26 times


Derek_Stewart
QL Wafer Drive
Posts: 1464
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Expanding the range of QL Adventures

Postby Derek_Stewart » Sat Jun 01, 2019 9:08 pm

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: 2
Joined: Sat Sep 02, 2017 4:56 pm

Re: Expanding the range of QL Adventures

Postby Itimpi » Sat Jun 01, 2019 9:18 pm

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.



Who is online

Users browsing this forum: MSN [Bot] and 4 guests