Simple time-waster game
Re: Simple time-waster game
Nice work, Steve! Just ran it on QPC2 - looks great.
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
Re: Simple time-waster game
Yes, nice work! 

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,
Old joke : A car factory exploded, so it started raining Datsun cogs.... Inspiration for a screen-saver !
UNZIP, LRUN or ESCape : Tested ok on QPC , (too slow on QLs). - Yet, 'elliptical' gears, and beware of the strobe effect...
Will try to adapt it for more intricate graphics output, after reorganising and optimising the code. Regards, Steve.
Old joke : A car factory exploded, so it started raining Datsun cogs.... Inspiration for a screen-saver !
UNZIP, LRUN or ESCape : Tested ok on QPC , (too slow on QLs). - Yet, 'elliptical' gears, and beware of the strobe effect...
Will try to adapt it for more intricate graphics output, after reorganising and optimising the code. Regards, Steve.
Re: Simple time-waster game
Nice work Steve. Never thought of drawing cogs like that!
Just where do you get the inspiration for all these little programs?
Just where do you get the inspiration for all these little programs?
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
- 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
Looks really nice...
BTW, I've been playing around in SuperBASIC a little more than usual recently and noticed an anomaly with the RND statement.
Seeding the random number generator gives different results on SMSQ/E than on QDOS.
For example, this code consistently prints 15615 on QDOS, but prints 29498 on SMSQ/E.
RANDOMISE 1011:PRINT RND(0 TO 32767)
I was working on something that relied on getting the same sequence of random numbers from a specific seed value and I found that I was getting different results on the two systems. I don't suppose this is important if you expect RND to be truly random.
...I just wondered if this is documented anywhere, and if anyone knew whether this is by accident or design.
I agree, I always look forward to downloading your code snippets Steve.dilwyn wrote: Thu Jun 27, 2024 11:45 am Just where do you get the inspiration for all these little programs?
BTW, I've been playing around in SuperBASIC a little more than usual recently and noticed an anomaly with the RND statement.
Seeding the random number generator gives different results on SMSQ/E than on QDOS.
For example, this code consistently prints 15615 on QDOS, but prints 29498 on SMSQ/E.
RANDOMISE 1011:PRINT RND(0 TO 32767)
I was working on something that relied on getting the same sequence of random numbers from a specific seed value and I found that I was getting different results on the two systems. I don't suppose this is important if you expect RND to be truly random.
...I just wondered if this is documented anywhere, and if anyone knew whether this is by accident or design.
- NormanDunbar
- Forum Moderator
- Posts: 2459
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: Simple time-waster game
I think there's a change in the rnd code in SMSQ. When RND is called, the seed value has the high and low words multiplied by different values. To quote myself in Issue 8 of my irregular Assembly Language eMagazines:
I suspect this is the reason for your anomalies.
Cheers,
Norm.
Marcel commented on this and he's not sure why different multipliers are used, although he did wonder if it made things more random....we grab hold of the random seed and start messing about with it to generate a new seed. The high word of the seed, in D0, is multiplied by 49,453 and the low word, in D4, by 28,973 neither of which are prime. Both are divisible by 7 if you don’t fancy working it out!
The resulting long word is D0 is swapped and added to D4 before D4 is incremented. This is our new random seed and is saved accordingly ready for the next call to the rnd routine.
I suspect this is the reason for your anomalies.
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: Simple time-waster game
Stev
Twinkle now Cogs what next… all very enjoyable.
This philosophical belief of minimalistic and uncluttered designs and using only what's essential to convey simplicity is effective at capturing attention and only focuses on the message - Stev I think you need to get out more…
QBITS
Twinkle now Cogs what next… all very enjoyable.
This philosophical belief of minimalistic and uncluttered designs and using only what's essential to convey simplicity is effective at capturing attention and only focuses on the message - Stev I think you need to get out more…

QBITS
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
Hi Guys,
I suppose I am just curious about most things: Recently I was reading about the fractional numbers involved in astronomical clock-making.
All pretty complex stuff, so I tried simple designs, using the much decried 'Turtle graphics' to avoid mind-twisting trigonometrics.
This allowed a fairly fast animation on QPC2, just to demonstrate the power of what can be output with our excellent QL basics.
No doubt in engineering they use software to calculate gearing required to allow lathes to cut non-standard threads already....
At my advanced age, I won't be producing any more scientific applications code. But who knows ? Regards, Steve.
I suppose I am just curious about most things: Recently I was reading about the fractional numbers involved in astronomical clock-making.
All pretty complex stuff, so I tried simple designs, using the much decried 'Turtle graphics' to avoid mind-twisting trigonometrics.
This allowed a fairly fast animation on QPC2, just to demonstrate the power of what can be output with our excellent QL basics.
No doubt in engineering they use software to calculate gearing required to allow lathes to cut non-standard threads already....
At my advanced age, I won't be producing any more scientific applications code. But who knows ? Regards, Steve.
-
- Aurora
- Posts: 888
- Joined: Mon Nov 24, 2014 2:03 pm
Re: Simple time-waster game
Hi again,
Many, many years ago somebody found and published a cure for the Random number generation problem.
Apparently, the RANDOMISE DATE function did not correctly reseed both words of the code, and a solution was given.
If I can find the remedy, I will report back again.... Steve.
___________________________________________________
Many, many years ago somebody found and published a cure for the Random number generation problem.
Apparently, the RANDOMISE DATE function did not correctly reseed both words of the code, and a solution was given.
If I can find the remedy, I will report back again.... Steve.
___________________________________________________
Re: Simple time-waster game
You could probably use something like Cogs to make a nice "mechanical" clock. Time, calendar, moon phases.. 

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