Random function on Mac is different than on Windows
Random function on Mac is different than on Windows
the Random function in PB for Windows accepts an optional minimum parameter but PB for Mac does not, an oversight?
Re: Random function on Mac is different than on Windows
It seems to work fine when I try it on PB 5.11.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Random function on Mac is different than on Windows
I was using version 5.0, not too crazy about the changes in versions 5.10+ but will give it a try.
[edit] it works in version 5.11 [/edit]
[edit] it works in version 5.11 [/edit]
Re: Random function on Mac is different than on Windows
The optional parameter was added in version 5.10 so that explains the problems you had.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Random function on Mac is different than on Windows
You can use the following in v5.0...
Code: Select all
Procedure RandomRange(FromRange, ToRange)
Range = ToRange - FromRange
RandomRange = FromRange + Random(Range)
ProcedureReturn RandomRange
EndProcedure
Loop = 0
Repeat
Loop +1
RR = RandomRange(15, 30)
Debug RR
Until Loop = 10www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
Re: Random function on Mac is different than on Windows
thank you J. Baker 

