Add pathfinidng support for square and hex grids

This commit is contained in:
Manuel Vögele
2022-01-30 00:06:48 +01:00
parent 1f770f7597
commit d467fe5bcf
10 changed files with 288 additions and 3 deletions
+6
View File
@@ -15,6 +15,12 @@ export function* enumeratedZip(it1, it2) {
}
}
export function* iterPairs(l) {
for (let i = 1;i < l.length;i++) {
yield [l[i - 1], l[i]];
}
}
export function sum(arr) {
return arr.reduce((a, b) => a + b, 0);
}