ChaiScript_Extras icon indicating copy to clipboard operation
ChaiScript_Extras copied to clipboard

Add random number generator

Open lefticus opened this issue 8 years ago • 4 comments

lefticus avatar Feb 22 '17 20:02 lefticus

Use C++11's random number generator to expose two wrapper functions to ChaiScript...

rand() // Random int between 0 and RAND_MAX
rand(max)
rand(min, max)
srand(seed)

Been trying to build ChaiScript_Extras in order to add such functions, but am running into compilation errors.... https://github.com/ChaiScript/ChaiScript_Extras/issues/4

Could be good to follow the same modal as math.random() in Lua.

RobLoach avatar Oct 13 '17 14:10 RobLoach

any Eta?

radiumx3 avatar Sep 26 '18 18:09 radiumx3

No one's worked on it. I have made a small wrapper for https://github.com/effolkronium/random ... Could port it to a ChaiScript module.

RobLoach avatar Sep 26 '18 20:09 RobLoach

Am I too late to say this would be very useful? I would much appreciate it if someone decided to work on this. Thanks.

diamante0018 avatar Mar 09 '21 10:03 diamante0018