refactor(generation): cultures start

This commit is contained in:
max 2022-07-24 23:32:59 +03:00
parent 1a57a8ac08
commit fe20f66b96
15 changed files with 621 additions and 581 deletions

View file

@ -4,12 +4,12 @@ import {ERROR} from "../config/logging";
import {minmax, rn} from "./numberUtils";
// random number in range
export function rand(min: number, max: number) {
if (min === undefined && max === undefined) return Math.random();
export function rand(min: number, max?: number) {
if (max === undefined) {
max = min;
min = 0;
}
return Math.floor(Math.random() * (max - min + 1)) + min;
}