| 1175 | return 1; |
| 1176 | } |
| 1177 | static int dfhack_random_unitvector(lua_State *L) |
| 1178 | { |
| 1179 | MersenneRNG *prng = check_random_native(L, 1); |
| 1180 | int size = luaL_optint(L, 2, 3); |
| 1181 | if (size <= 0 || size > 32) |
| 1182 | luaL_argerror(L, 2, "vector size must be positive"); |
| 1183 | luaL_checkstack(L, size, "not enough stack in dfhack.random.unitvector"); |
| 1184 | |
| 1185 | vector<double> buf(size); |
| 1186 | prng->unitvector(buf.data(), size); |
| 1187 | |
| 1188 | for (int i = 0; i < size; i++) |
| 1189 | lua_pushnumber(L, buf[i]); |
| 1190 | return size; |
| 1191 | } |
| 1192 | |
| 1193 | static int eval_perlin_1(lua_State *L) |
| 1194 | { |
nothing calls this directly
no test coverage detected