mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor(generation): cultures start
This commit is contained in:
parent
1a57a8ac08
commit
fe20f66b96
15 changed files with 621 additions and 581 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue