🚀 refactor getBestRoute

This commit is contained in:
platane
2020-07-30 18:33:42 +02:00
parent 9ab55aaad6
commit 3625bdb819
17 changed files with 630 additions and 304 deletions

View File

@@ -1,7 +1,7 @@
import { getGithubUserContribution, Cell } from "@snk/github-user-contribution";
import { setColor, createEmptyGrid } from "@snk/compute/grid";
import { computeBestRun } from "@snk/compute";
import { createGif } from "../gif-creator";
import { createGif } from "@snk/gif-creator";
import { getBestRoute } from "@snk/compute/getBestRoute";
export const userContributionToGrid = (cells: Cell[]) => {
const width = Math.max(0, ...cells.map((c) => c.x)) + 1;
@@ -43,7 +43,7 @@ export const generateContributionSnake = async (userName: string) => {
const gifOptions = { delay: 3 };
const commands = computeBestRun(grid0, snake0, gameOptions);
const commands = getBestRoute(grid0, snake0, gameOptions, 600);
const buffer = await createGif(
grid0,