rn2(10) */
| 922 | |
| 923 | /* rn2(10) */ |
| 924 | staticfn int |
| 925 | nhl_rn2(lua_State *L) |
| 926 | { |
| 927 | int argc = lua_gettop(L); |
| 928 | |
| 929 | if (argc == 1) |
| 930 | lua_pushinteger(L, rn2((int) luaL_checkinteger(L, 1))); |
| 931 | else |
| 932 | nhl_error(L, "Wrong args"); |
| 933 | |
| 934 | return 1; |
| 935 | } |
| 936 | |
| 937 | /* random(10); -- is the same as rn2(10); */ |
| 938 | /* random(5,8); -- same as 5 + rn2(8); */ |