fixes and boundingBox simplification for flat-topped-square boards
This commit is contained in:
18
src/utils.js
18
src/utils.js
@@ -57,3 +57,21 @@ export function random(min, max) {
|
||||
return min + Math.floor(Math.random() * (max - min + 1));
|
||||
}
|
||||
|
||||
export function range (start, end) {
|
||||
if (end == null) {
|
||||
end = start;
|
||||
start = 0;
|
||||
}
|
||||
|
||||
return Array.from(Array(end - start), (_value, index) => index + start);
|
||||
}
|
||||
|
||||
export function rangeInclusive(start, end) {
|
||||
if (end == null) {
|
||||
end = start;
|
||||
start = 0;
|
||||
}
|
||||
|
||||
return range(start, end+1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user