Simple time-waster game

Anything QL Software or Programming Related.
Derek_Stewart
Font of All Knowledge
Posts: 4655
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Simple time-waster game

Post by Derek_Stewart »

I lose a lot of time playing QOMBI...


Regards,

Derek
stevepoole
Aurora
Posts: 888
Joined: Mon Nov 24, 2014 2:03 pm

Re: Simple time-waster game

Post 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.

_______________________________


User avatar
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

Post 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.


stevepoole
Aurora
Posts: 888
Joined: Mon Nov 24, 2014 2:03 pm

Re: Simple time-waster game

Post 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.


User avatar
dilwyn
Mr QL
Posts: 3054
Joined: Wed Dec 01, 2010 10:39 pm

Re: Simple time-waster game

Post 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" :lol: 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


stevepoole
Aurora
Posts: 888
Joined: Mon Nov 24, 2014 2:03 pm

Re: Simple time-waster game

Post 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.
Clocks.zip
(1.22 KiB) Downloaded 112 times


User avatar
pjw
QL Wafer Drive
Posts: 1607
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Simple time-waster game

Post 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..


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
pjw
QL Wafer Drive
Posts: 1607
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Simple time-waster game

Post 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..


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
stevepoole
Aurora
Posts: 888
Joined: Mon Nov 24, 2014 2:03 pm

Re: Simple time-waster game

Post by stevepoole »

Hi Folks,

Here's a screen shot of the 'Clocks_bas' program running.... Regards, Steve.
Capture d’écran (412).png


stevepoole
Aurora
Posts: 888
Joined: Mon Nov 24, 2014 2:03 pm

Re: Simple time-waster game

Post by stevepoole »

Hi per,

Quote : " Don't be Happy, Worry...", so here's another time_waster program which reflects current woes : Regards, Steve.
Rockit.zip
(1.25 KiB) Downloaded 125 times


Post Reply