🔨 rename package compute -> solver

This commit is contained in:
platane
2021-01-11 23:50:00 +01:00
parent fd7202c05e
commit a3f79b9ca4
35 changed files with 27 additions and 37 deletions

View File

@@ -0,0 +1,12 @@
import { createEmptyGrid } from "@snk/types/grid";
import { getHeadX, getHeadY } from "@snk/types/snake";
import { snake3 } from "@snk/types/__fixtures__/snake";
import { getPathTo } from "../getPathTo";
it("should find it's way in vaccum", () => {
const grid = createEmptyGrid(5, 0);
const path = getPathTo(grid, snake3, 5, -1)!;
expect([getHeadX(path[0]), getHeadY(path[0])]).toEqual([5, -1]);
});