mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add Random class
This commit is contained in:
parent
28afa4b6bf
commit
532c4887bc
3 changed files with 38 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ static int l_random(lua::State* L) {
|
|||
std::uniform_real_distribution<> dist(0.0, 1.0);
|
||||
return lua::pushnumber(L, dist(randomEngine));
|
||||
} else if (argc == 1) {
|
||||
std::uniform_int_distribution<integer_t> dist(0, lua::tointeger(L, 1));
|
||||
std::uniform_int_distribution<integer_t> dist(1, lua::tointeger(L, 1));
|
||||
return lua::pushinteger(L, dist(randomEngine));
|
||||
} else {
|
||||
std::uniform_int_distribution<integer_t> dist(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue