Oric doesn't like the following line despite the fact it's in the manual!
A = INT(RND(I)*6+1
(taken from page 66 for the curious)
What's wrong here? I tried putting all of the sample program on Oric and it came back with an error on this line.
RND function
There is an error on that page, it should read
Code: Select all
40 A = INT(RND(1)*6)+1
sorry to hijack the thread, but since it is related, I might as well post it here.
x=int(rnd(1)*100)+1
that should make x always be between 1 and 100
Now, on the MacOSX version of the emulator, it always comes back with the same number.
even after re initializing the emulator.
As we know, RND produces pseudo random numbers, but it should have changed it time for x (when looped).
Is this a bug in the emulator, or does anyone remember a BASIC command to initialize the RND function.
On some machines it used to be RANDOMIZE (or RAND)
not so in Oric basic.
RND(0) use to work on other machines.
It has been about 25 years, if anyone remembers how to reinitialize the RND function, please let me know.
(was it a POKE somewhere??)
Thanks!
x=int(rnd(1)*100)+1
that should make x always be between 1 and 100
Now, on the MacOSX version of the emulator, it always comes back with the same number.
even after re initializing the emulator.
As we know, RND produces pseudo random numbers, but it should have changed it time for x (when looped).
Is this a bug in the emulator, or does anyone remember a BASIC command to initialize the RND function.
On some machines it used to be RANDOMIZE (or RAND)
not so in Oric basic.
RND(0) use to work on other machines.
It has been about 25 years, if anyone remembers how to reinitialize the RND function, please let me know.
(was it a POKE somewhere??)
Thanks!
I have tested this on Euphoric and it works for me, so it must be an error on the emulator.Kronos wrote:sorry to hijack the thread, but since it is related, I might as well post it here.
x=int(rnd(1)*100)+1
that should make x always be between 1 and 100
Now, on the MacOSX version of the emulator, it always comes back with the same number.
even after re initializing the emulator.
As we know, RND produces pseudo random numbers, but it should have changed it time for x (when looped).
Is this a bug in the emulator, or does anyone remember a BASIC command to initialize the RND function.
On some machines it used to be RANDOMIZE (or RAND)
not so in Oric basic.
RND(0) use to work on other machines.
It has been about 25 years, if anyone remembers how to reinitialize the RND function, please let me know.
(was it a POKE somewhere??)
Thanks!
However beware that the parameter has a somewhat strange meaning. If I remember correctly RND(1) generates random numbers between 0 and 1, and that is the only way to generate them. I mean passing RND(4) does not generate numbers between 0 and 4.
The parameters worked on an akward way, such as RND(0) generating the last computed random number again (?) and using a negative param doing other strange things... better check the manual (you can found it online here in defence-force).
I think there is no way of reestarting the number generator with an initial seed from BASIC, but maybe a POKE could do something... can't help in this point.
Hope this helps... somehow...
Cheers
That's not the only oneChris wrote:It's interesting that the Oric manual would have a typo. Also interesting is how a simple closed parenthesis would make a computer not behave the way it's supposed to. That fixed my problem. Thanks Pengwin.
In the french Atmos Manual, the same mistake appears on two different pages (pictures here at the bottom of the page : http://www.oricgames.com/forum,fr,66,109,1.html )
It is dealing with the CSAVE of the hires screen :
Code: Select all
CSAVE "FileName",A40960,E48000
I leave you find where is the "bug"
Re
The same typo regarding the CSAVE function is present in Croatian translation of Oric Atmos manual (the book that came with my Oric Atmos)
on Croatian language!
Because of this error in the manual it took me rather long time to realise how to CSAVE a HIRES screen!
on Croatian language!
Because of this error in the manual it took me rather long time to realise how to CSAVE a HIRES screen!