Oddity with RND

Anything QL Software or Programming Related.
Post Reply
RWAP
RWAP Master
Posts: 2901
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Oddity with RND

Post by RWAP »

I was just trying my back catalogue of games on Minerva, and came across an instance where Night Nurse didn't run even in 128K mode.

It reported an error in BASIC - the line was:

yrand = RND(60 TO 100,120 TO 190)

It is interesting that the JM and JS ROMs do not complain about this and appear to work - although they seem to do the equivalent of

yrand = RND(60 TO 100)

Has anyone come across this before - it might actually be a useful addition to specify more than one range!


User avatar
t0nyt
QL Wafer Drive
Posts: 1217
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Oddity with RND

Post by t0nyt »

Hi Rich

I came across this when I was trying to get Night Nurse running on Minerva too

Sorry, I probably should have mentioned it!

IIRC JS doesn’t do anything with the 2nd range, just ignores it?


RWAP
RWAP Master
Posts: 2901
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Oddity with RND

Post by RWAP »

Yes, it does seem to ignore it. I have re-written the code to correct the issue.


User avatar
Sebright
Bent Pin Expansion Port
Posts: 88
Joined: Fri Feb 07, 2025 9:55 am

Re: Oddity with RND

Post by Sebright »

Funny enough, I came up with “Knight Nurse” as a game idea recently, set in Camelot. “When the day’s work is done, he sets down his lance and picks up his lancet.”

I ran it past my wife and she gave it a firm NO!


Finding Evan - a text adventure with graphics for SMSQ/E & QDOS
Otis Travels In Space - QDOS only... Find them here!
User avatar
NormanDunbar
Forum Moderator
Posts: 2520
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: Oddity with RND

Post by NormanDunbar »

:D :D :D :D :D


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