🚀 report error in demo

This commit is contained in:
platane
2020-10-24 00:15:47 +02:00
parent 43aa3022af
commit 64b04e9eba
2 changed files with 11 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ export const getBestRoute = (grid0: Grid, snake0: Snake) => {
const chunk = pruneLayer(grid, color, snakeN);
const c = cleanLayer(gridN, chain[0], chunk);
if (c) chain.unshift(...c);
else throw new Error("some cells are unreachable");
}
return chain.reverse().slice(1);