Random Numbers
Moderator: Team Members
- Eradani
- Posts: 192
- Joined: Wed May 05, 2010 6:25 am
- Location: Saskatchewan
Random Numbers
what are we using for random number generation? is it in C++ or LUA
(couldn't find anything in http://www.eq2emulator.net/wiki/index.p ... _Functions concerning random numbers)
what is it returning?
a) random() = float 0.0 .. 0.999999999
b) random(10) = 1..10
c) random(10) = 0..9
d) random(7, 14) = 7..14
(couldn't find anything in http://www.eq2emulator.net/wiki/index.p ... _Functions concerning random numbers)
what is it returning?
a) random() = float 0.0 .. 0.999999999
b) random(10) = 1..10
c) random(10) = 0..9
d) random(7, 14) = 7..14
my client version: 12682L, 2016/06/06
last one that will run on XP cause i'm just a stick-in-the-mud
last one that will run on XP cause i'm just a stick-in-the-mud
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Random Numbers
It depends where you want to use it. In the server code you can use rand(). I also remember I implemented at least one random number generating function in common/miscfunctions.cpp. In LUA you can use math.random().
- Eradani
- Posts: 192
- Joined: Wed May 05, 2010 6:25 am
- Location: Saskatchewan
Re: Random Numbers
sorry, must have been 1/2 asleep when i asked this. found the Lua Reference manual and, of course at the bottom of a pile of books, my [url=desk://topOfPile.Books]C++ manual[/url].
my client version: 12682L, 2016/06/06
last one that will run on XP cause i'm just a stick-in-the-mud
last one that will run on XP cause i'm just a stick-in-the-mud
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
- Eradani
- Posts: 192
- Joined: Wed May 05, 2010 6:25 am
- Location: Saskatchewan
Re: Random Numbers
hehe, you didn't look at the link for
Eradani wrote:my [url=desk://topOfPile.Books]C++ manual[/url].
my client version: 12682L, 2016/06/06
last one that will run on XP cause i'm just a stick-in-the-mud
last one that will run on XP cause i'm just a stick-in-the-mud
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Re: Random Numbers
Invalid link for me url=desk:topOfPile.BooksEradani wrote:hehe, you didn't look at the link forEradani wrote:my [url=desk://topOfPile.Books]C++ manual[/url].
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Random Numbers
These guys are kinda thick, huh?
- Eradani
- Posts: 192
- Joined: Wed May 05, 2010 6:25 am
- Location: Saskatchewan
Re: Random Numbers
good thing i don't make platz telling jokes
my client version: 12682L, 2016/06/06
last one that will run on XP cause i'm just a stick-in-the-mud
last one that will run on XP cause i'm just a stick-in-the-mud
Who is online
Users browsing this forum: No registered users and 0 guests