Skip to content

Commit

Permalink
fix: fix set seed for random
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Nov 7, 2023
1 parent 9db2016 commit c3f3499
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eco.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,13 @@ int main(int argc, char *const argv[])

signal(SIGPIPE, SIG_IGN);

srand(time(NULL));

L = luaL_newstate();

luaL_openlibs(L);

luaL_loadstring(L, "math.randomseed(os.time())");
lua_pcall(L, 0, 0, 0);

luaL_loadstring(L,
"table.keys = function(t)"
"local keys = {}"
Expand Down

0 comments on commit c3f3499

Please sign in to comment.