🔨 fix typing
This commit is contained in:
@@ -1,23 +1,19 @@
|
||||
import { createCanvas } from "./canvas";
|
||||
import { Snake, snakeToCells } from "@snk/compute/snake";
|
||||
import { snakeToCells } from "@snk/compute/snake";
|
||||
import { GUI } from "dat.gui";
|
||||
import { grid, snake } from "./sample";
|
||||
import { getAvailableInterestingRoutes } from "@snk/compute/getAvailableRoutes";
|
||||
import { getAvailableRoutes } from "@snk/compute/getAvailableRoutes";
|
||||
import type { Point } from "@snk/compute/point";
|
||||
import type { Snake } from "@snk/compute/snake";
|
||||
|
||||
//
|
||||
// compute
|
||||
|
||||
const routes: Snake[][] = [];
|
||||
getAvailableInterestingRoutes(
|
||||
grid,
|
||||
snake,
|
||||
(chain) => {
|
||||
routes.push(chain);
|
||||
return routes.length > 10;
|
||||
},
|
||||
2
|
||||
);
|
||||
getAvailableRoutes(grid, snake, (chain) => {
|
||||
routes.push(chain);
|
||||
return routes.length > 10;
|
||||
});
|
||||
|
||||
const config = { routeN: 0, routeK: 0 };
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createCanvas } from "./canvas";
|
||||
import { Color, copyGrid } from "../compute/grid";
|
||||
import { grid, snake } from "./sample";
|
||||
import { pruneLayer } from "@snk/compute/getBestRoute-layer";
|
||||
import { pruneLayer } from "@snk/compute/pruneLayer";
|
||||
|
||||
const colors = [1, 2, 3] as Color[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user