Simple time-waster game
-
- Font of All Knowledge
- Posts: 4655
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
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.
_______________________________
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.
_______________________________
- Mark Swift
- Bent Pin Expansion Port
- Posts: 86
- Joined: Fri Jul 18, 2014 9:13 am
- Location: Blackpool, Lancs, UK
- Contact:
Re: Simple time-waster game
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.
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.
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
Hi Mark,
Just remembered the name of the fix you are looking for : TRUE_RANDOMISE ... , but I still cannot find it yet ! Steve.
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
It was by Mark Knight in QL Toady. EmmBee wrote about it a few years ago: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.
https://sinclairql.net/qlt/QLToday_V01-I6_en.pdfIt'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.
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
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.
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
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:
Under heavy load, or when accessing certain drives, this timer misses a few beats, but then catches up when it can..

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
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Re: Simple time-waster game
PS. Just a fun factoid: In SBASIC you can skip the d$ variable and go straight to:
Sadly neither SuperBASIC nor Qlib accept it..
Code: Select all
180 AT 0, 0: PRINT DATE$(d - t)(13 TO)
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
Hi Folks,
Here's a screen shot of the 'Clocks_bas' program running.... Regards, Steve.
Here's a screen shot of the 'Clocks_bas' program running.... Regards, Steve.
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
Hi per,
Quote : " Don't be Happy, Worry...", so here's another time_waster program which reflects current woes : Regards, Steve.
Quote : " Don't be Happy, Worry...", so here's another time_waster program which reflects current woes : Regards, Steve.