Page 1 of 29

QL Tinkering

Posted: Wed Jan 04, 2017 6:41 pm
by qbits
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

Re: QL Tinkering

Posted: Fri Jan 06, 2017 11:34 am
by qbits
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

Re: QL Tinkering

Posted: Sun Jan 08, 2017 1:55 pm
by qbits
Continuing the journey of my QL Programming this was my Early Learning Phase as I call it.
See attached.

Qbits

Re: QL Tinkering

Posted: Mon Jan 09, 2017 10:19 am
by Cristian
Nice!
Thanks!

Re: QL Tinkering

Posted: Fri Jan 13, 2017 8:28 pm
by qbits
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

Re: QL Tinkering

Posted: Sat Jan 14, 2017 5:03 pm
by qbits
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:-

Re: QL Tinkering

Posted: Sat Jan 28, 2017 9:49 am
by tcat
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

Re: QL Tinkering

Posted: Sun Feb 12, 2017 5:35 pm
by qbits
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.

Re: QL Tinkering

Posted: Sun Feb 12, 2017 10:02 pm
by dilwyn
Thank you Steve, I've added these to the QL Home Page.

Re: QL Tinkering

Posted: Sun Feb 12, 2017 10:14 pm
by Cristian
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!