🚀 go back to first position

This commit is contained in:
platane
2020-11-01 13:44:09 +01:00
parent bfd53d721d
commit 686f61d725
4 changed files with 75 additions and 0 deletions

View File

@@ -3,8 +3,10 @@ import { getBestRoute } from "@snk/compute/getBestRoute";
import { createSvg } from "../svg-creator";
import { grid, snake } from "./sample";
import { drawOptions } from "./canvas";
import { getPathToPose } from "@snk/compute/getPathToPose";
const chain = getBestRoute(grid, snake);
chain.push(...getPathToPose(chain.slice(-1)[0], snake)!);
const svg = createSvg(grid, chain, drawOptions, { frameDuration: 200 });
const container = document.createElement("div");