QL Tinkering

Helpful tips and guides, also new users can ask for help here.
qbits
ROM Dongle
Posts: 20
Joined: Sun Dec 11, 2016 3:32 pm

QL Tinkering

Postby qbits » Wed Jan 04, 2017 6:41 pm

Hi to all those who like me have returned to the fold and maybe on a mission to complete those early attempt at programming. Not to overlook any new to the QL scene, I hope my postings, the advice and suggestions received from others will benefit us all.

For WRAP and Dilywn any programs uploaded, warts and all, I have no objection for them to be added to your growing collection as QBITS free downloads on the understanding that for whatever reason that may arise there is no public liability attached to me.

Well now that’s said and done, over the coming weeks, months I hope to share more of my QBITS journey the early programs and updates as I return to enhance my skills in SuperBASIC programming.

An early necessity I found of great benefit while experimenting with programming code was to have a helping hand managing all the small files I produced. The QBITS File Tidy began its life soon after I bought my first QL see attached.

Qbits

Edit 1 04/01/2017
Apologies error with QBFTidy version I uploaded [copy command] now been changed.


Edit 2 05/01/2017
My original FTidy had a few lines of code that had an additional MOVE command an extension of Copy and Delete. In removing the extra bit of code I left a variable which caused an error. I also then realised the Copy command should not try to Copy from source to target if they were the same device. So I’ve added a block to this happening - see code change below.

QBFTidy DEF PROC F_copy

301 IF TDR$=SDR$:F_clear:RETurn (added following lines renumbered)
302 CURSOR #5,px%,py%:PRINT #5,TDR$&' Overwrite <y/n>'
303 px%=84:py%=6:Fnum%=n:k$=INKEY$(#5,-1)
304 IF k$=='y' OR k$=CHR$(10)
305 FOR n=1 TO ftot%
306 IF Sett(n)=7
307 CURSOR #5,px%,py%:PRINT #5,file$(n)&' TO '&TDR$:CLS #5,4
308 DELETE TDR$&file$(n):COPY SDR$&file$(n) TO TDR$&file$(n)
308 IF chg>0:DELETE SDR$&file$(n) (Deleted line)

The Uploaded files have been update
Attachments
QBFTidy201701.pdf
(1.06 MiB) Downloaded 27 times
QBFTidy.zip
(5.97 KiB) Downloaded 28 times


qbits
ROM Dongle
Posts: 20
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Fri Jan 06, 2017 11:34 am

Hi,
Checking through my old files I found my 1992 QBITS version of a mine sweeper style of game. An almost direct copy of the code I wrote in 1987 and my earliest attempt at programming of a game.

Qbits
Attachments
QBMD_bas.zip
(3.19 KiB) Downloaded 20 times


qbits
ROM Dongle
Posts: 20
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Sun Jan 08, 2017 1:55 pm

Continuing the journey of my QL Programming this was my Early Learning Phase as I call it.
See attached.

Qbits
Attachments
QBConundrum.pdf
(994.15 KiB) Downloaded 30 times
QBConundrum.zip
(20.83 KiB) Downloaded 21 times


Cristian
Gold Card
Posts: 275
Joined: Mon Feb 16, 2015 1:40 pm

Re: QL Tinkering

Postby Cristian » Mon Jan 09, 2017 10:19 am

Nice!
Thanks!


qbits
ROM Dongle
Posts: 20
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Fri Jan 13, 2017 8:28 pm

QBDarts has been a long drawn out process from conception in the eighties to hopefully fulfilling most of my early aspirations. Working the code for QBDarts I came across what I can only describe as an intriguing abnormality.

100 REMark Score_Test
102 REMark score=runnimg score dp=dart points
104 :
106 PAPER 7:CLS:INK 0:PRINT 'n score - dp <=1 RED score<dp GREEN'
108 FOR n=1 TO 18
110 score=10:dp=6+n:INK 0:PRINT n,score,dp
112 INK 4:IF score<dp:CURSOR 120,10*n:PRINT score,dp;' '
114 INK 2:IF score-dp<=1:dp=0:CURSOR 120,10*n:PRINT score,dp;' '
116 END FOR n

If you check this out it will show the IF statement of line 114 does not hold true for 10-12, 10-14 and 10-18.
Can anyone explain this!!!
I’ve included this short prog with the QBDarts.zip

Qbits
Attachments
QBDarts ext.pdf
(1.34 MiB) Downloaded 9 times
QBDarts.zip
(3.33 KiB) Downloaded 7 times
Last edited by qbits on Tue Mar 28, 2017 1:55 pm, edited 1 time in total.


qbits
ROM Dongle
Posts: 20
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Sat Jan 14, 2017 5:03 pm

I have been reviewing the QBITS Golf code and updated it with some of your suggestion. One problem I encountered was that running under the SMSQemulator was that the Bunkers not being recognised.

DEF PROC test
This checks the getcolor results to see if they match with any hazard.
The line:- IF c1=2 AND c3=5 OR C1=5 AND c4=2: bunkered – for some reason did not work!

The check on c1, c2, c3,c4 give 2 2 5 5 or 5 5 2 2 this works with the QL2K emulator as expected but not with the SMSQmulator. Another combination for c1,c2,c3,c4 giving 1 1 6 6 or 6 6 6 1 1 also does not work.

However if I use the c1,c2,c3,c4 combination of 3 3 7 7 or 7 7 3 3 which gives the Bunkers a pinkish look this does appear to function. The attached .zip file contains updated versions for the QL2K and SMSQmulator.

Qbits

The progs uploaded so far shown running on the QMSQmulator:-
Attachments
QBITS SMSQ.jpg
QBGolf 2017 01.pdf
(1.76 MiB) Downloaded 31 times
QBGolf 2017.zip
(13.56 KiB) Downloaded 20 times


tcat
Gold Card
Posts: 376
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: QL Tinkering

Postby tcat » Sat Jan 28, 2017 9:49 am

Hi Qbits,

I like your progs, it simply demonstrates good stuff can be coded just in BASIC on a plain QL.
I wonder about other titles of yours, you did share yet, but are shown in the screen preview?

Tomas


qbits
ROM Dongle
Posts: 20
Joined: Sun Dec 11, 2016 3:32 pm

Re: QL Tinkering

Postby qbits » Sun Feb 12, 2017 5:35 pm

Hi,
So over the Christmas period I managed to get access to some of my QL goodies in our loft space. Among which was a folder with sketches, notes and a number of QBITS programs I had printed out. One caught my eye ASRS - Automatic Storage and Retrieval System. Searching my QL floppies, I discovered STOREMAN_SAM and WAREHOUSE_SAM. But also various files that implied a third generation I’ve dubbed QBITs Warehouses (QBWH for short). It’s taken a few hours to relearn my SuperBASIC and get the bits of code together and hopefully fulfil my earlier aspirations!

I’ve also added a small prog my attempt to gain some incite to the use of random numbers.

Let me know what you think and any help with tweaks to the code will be appreciated.

Qbits

Note: Tried it on Qemulator (original QL Mode - obviously a bit slow) QL2K and SMSQumlator.
Attachments
RanGen.jpg
QBWH.jpg
QBWH_Game.pdf
(1.59 MiB) Downloaded 25 times
QBWH_Game.zip
(20.15 KiB) Downloaded 19 times


User avatar
dilwyn
Mr QL
Posts: 1118
Joined: Wed Dec 01, 2010 10:39 pm
Location: Wales
Contact:

Re: QL Tinkering

Postby dilwyn » Sun Feb 12, 2017 10:02 pm

Thank you Steve, I've added these to the QL Home Page.


Dilwyn
All things QL: see www.dilwyn.me.uk
Cristian
Gold Card
Posts: 275
Joined: Mon Feb 16, 2015 1:40 pm

Re: QL Tinkering

Postby Cristian » Sun Feb 12, 2017 10:14 pm

qbits wrote:Let me know what you think and any help with tweaks to the code will be appreciated.

Qbits,
your programs are great but their manuals are fantastic!



Return to “Help for New Users”

Who is online

Users browsing this forum: No registered users and 1 guest