Page 3 of 6
Re: Simple time-waster game
Posted: Fri Jun 28, 2024 10:20 pm
by Derek_Stewart
I lose a lot of time playing QOMBI...
Re: Simple time-waster game
Posted: Sat Jun 29, 2024 7:05 am
by stevepoole
Hi Mark,
Hope you don't object to my diffusing your AverageBrainScore game, at a wedding party event this afternoon :
Each guest will be invited to test their score, and the final winner will get a prize ! An ideal program for the occasion !
I reset the maximum number to 99, as their will be children playing too, so I will have to keep an eye on them....
Of course there will be a lot of other party games, but this will be the first time a computer will have been used.
Many thanks in advance, Steve.
_______________________________
Re: Simple time-waster game
Posted: Sat Jun 29, 2024 11:01 am
by Mark Swift
Hi Steve,
Please do, I'm honoured. Hope it goes well.
I do have another simple SuperBASIC game I'm working on, hence the question about RND earlier.
Unfortunately although it's simple in my head, it's turning out to be a little difficult to code.
Mark.
Re: Simple time-waster game
Posted: Mon Jul 01, 2024 6:40 pm
by stevepoole
Hi Mark,
Just remembered the name of the fix you are looking for : TRUE_RANDOMISE ... , but I still cannot find it yet ! Steve.
Re: Simple time-waster game
Posted: Mon Jul 01, 2024 7:47 pm
by dilwyn
stevepoole wrote: Mon Jul 01, 2024 6:40 pm
Hi Mark,
Just remembered the name of the fix you are looking for : TRUE_RANDOMISE ... , but I still cannot find it yet ! Steve.
It was by Mark Knight in QL Toady. EmmBee wrote about it a few years ago:
It's in Volume 01 Issue 6_en. RANDOMISE DATE is described as a "waste of time"

This works on the most significant 16 bits - which doesn't vary often enough to be effective.
https://sinclairql.net/qlt/QLToday_V01-I6_en.pdf
Re: Simple time-waster game
Posted: Tue Jul 02, 2024 3:43 pm
by stevepoole
Hi Per and All,
Yes, I tried simulating a real mechanical clock mechanism, as you suggested, (but without a moon phase dial based on DATE).
It proved to be impossible to get the timing right, except by hooking it onto the QPC2 DATE$ function, (even using 'wait' FOR loops ! )
The problem is due to multicore multitasking going on in the background. It adjusts best with the slow/fast 'Fc' variable, line 670.
And, don't move your mouse off screen ! To avoid clutter, I simplified the number of cog teeth for better animation.
Still, it would be more readily comprehensible with an 'exploded' view, (requiring innumerable ellipical trigonometry calculations.)
As it is, code is compact thanks to Turtle Graphics. UNZIP, LRUN or ESCape, Regards, Steve.
Re: Simple time-waster game
Posted: Tue Jul 02, 2024 4:53 pm
by pjw
Nice one, Steve. Has potential potential
Im not sure what you mean about getting the timing right. Loops are too inaccurate but the clock itself (DATE) is pretty accurate, viz:
Code: Select all
100 CLS
110 t = DATE: REMark Base time
120 d = t: REMark Current time
130 dd = d: REMark Delta time
140 wait = 5: REMark Accuracy?
150 PRINT '00:00:00'
160 REPeat timer
170 IF dd < d THEN
180 d$ = DATE$(d - t)
190 AT 0, 0: PRINT d$(13 TO)
200 dd = d
210 END IF
220 d = DATE
230 IF CODE(INKEY$(wait)) = 27: EXIT timer
240 END REPeat timer
Under heavy load, or when accessing certain drives, this timer misses a few beats, but then catches up when it can..
Re: Simple time-waster game
Posted: Tue Jul 02, 2024 4:59 pm
by pjw
PS. Just a fun factoid: In SBASIC you can skip the d$ variable and go straight to:
Code: Select all
180 AT 0, 0: PRINT DATE$(d - t)(13 TO)
Sadly neither SuperBASIC nor Qlib accept it..
Re: Simple time-waster game
Posted: Wed Jul 03, 2024 6:59 am
by stevepoole
Hi Folks,
Here's a screen shot of the 'Clocks_bas' program running.... Regards, Steve.
Re: Simple time-waster game
Posted: Wed Jul 03, 2024 2:49 pm
by stevepoole
Hi per,
Quote : " Don't be Happy, Worry...", so here's another time_waster program which reflects current woes : Regards, Steve.