fixes and boundingBox simplification for flat-topped-square boards

This commit is contained in:
Gavin McDonald
2018-07-01 09:57:35 -04:00
parent 093bc435af
commit fbd4805970
2 changed files with 31 additions and 21 deletions

View File

@@ -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);
}