🚀 refactor algorithm

This commit is contained in:
platane
2020-10-29 23:27:08 +01:00
parent 1c6814c2fa
commit d81ecec836
27 changed files with 274 additions and 777 deletions

View File

@@ -15,7 +15,7 @@ it("should find best route", () => {
const chain = getBestRoute(grid, createSnakeFromCells(snk0))!;
expect(snakeToCells(chain[0])[1]).toEqual({ x: 0, y: 0 });
expect(snakeToCells(chain[1])[1]).toEqual({ x: 0, y: 0 });
expect(snakeToCells(chain[chain.length - 1])[0]).toEqual({ x: 3, y: 3 });
});