🔨 rename package compute -> solver
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import "./menu";
|
||||
import { createCanvas } from "./canvas";
|
||||
import { getBestRoute } from "@snk/compute/getBestRoute";
|
||||
import { getBestRoute } from "@snk/solver/getBestRoute";
|
||||
import { Color, copyGrid } from "@snk/types/grid";
|
||||
import { grid, snake } from "./sample";
|
||||
import { step } from "@snk/compute/step";
|
||||
import { step } from "@snk/solver/step";
|
||||
|
||||
const chain = getBestRoute(grid, snake)!;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { createCanvas } from "./canvas";
|
||||
import { getSnakeLength } from "@snk/types/snake";
|
||||
import { grid, snake } from "./sample";
|
||||
import { getColor } from "@snk/types/grid";
|
||||
import { getBestTunnel } from "@snk/compute/getBestTunnel";
|
||||
import { createOutside } from "@snk/compute/outside";
|
||||
import { getBestTunnel } from "@snk/solver/getBestTunnel";
|
||||
import { createOutside } from "@snk/solver/outside";
|
||||
import type { Color } from "@snk/types/grid";
|
||||
import type { Point } from "@snk/types/point";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import "./menu";
|
||||
import { createCanvas } from "./canvas";
|
||||
import { copySnake, snakeToCells } from "@snk/types/snake";
|
||||
import { grid, snake as snake0 } from "./sample";
|
||||
import { getPathTo } from "@snk/compute/getPathTo";
|
||||
import { getPathTo } from "@snk/solver/getPathTo";
|
||||
|
||||
const { canvas, ctx, draw, getPointedCell, highlightCell } = createCanvas(grid);
|
||||
canvas.style.pointerEvents = "auto";
|
||||
|
||||
@@ -2,7 +2,7 @@ import "./menu";
|
||||
import { createCanvas } from "./canvas";
|
||||
import { createSnakeFromCells, snakeToCells } from "@snk/types/snake";
|
||||
import { grid, snake } from "./sample";
|
||||
import { getPathToPose } from "@snk/compute/getPathToPose";
|
||||
import { getPathToPose } from "@snk/solver/getPathToPose";
|
||||
|
||||
const { canvas, ctx, draw, highlightCell } = createCanvas(grid);
|
||||
canvas.style.pointerEvents = "auto";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getBestRoute } from "@snk/compute/getBestRoute";
|
||||
import { getBestRoute } from "@snk/solver/getBestRoute";
|
||||
import { Color, copyGrid, Grid } from "@snk/types/grid";
|
||||
import { step } from "@snk/compute/step";
|
||||
import { step } from "@snk/solver/step";
|
||||
import { isStableAndBound, stepSpring } from "./springUtils";
|
||||
import { Res } from "@snk/github-user-contribution";
|
||||
import { Snake } from "@snk/types/snake";
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "@snk/draw/drawWorld";
|
||||
import { userContributionToGrid } from "../action/userContributionToGrid";
|
||||
import { snake4 as snake } from "@snk/types/__fixtures__/snake";
|
||||
import { getPathToPose } from "@snk/compute/getPathToPose";
|
||||
import { getPathToPose } from "@snk/solver/getPathToPose";
|
||||
import { createSvg } from "../svg-creator";
|
||||
|
||||
const createForm = ({
|
||||
|
||||
@@ -2,7 +2,7 @@ import "./menu";
|
||||
import { createCanvas } from "./canvas";
|
||||
import { grid } from "./sample";
|
||||
import type { Color } from "@snk/types/grid";
|
||||
import { createOutside, isOutside } from "@snk/compute/outside";
|
||||
import { createOutside, isOutside } from "@snk/solver/outside";
|
||||
|
||||
const { canvas, ctx, draw, highlightCell } = createCanvas(grid);
|
||||
document.body.appendChild(canvas);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import "./menu";
|
||||
import { getBestRoute } from "@snk/compute/getBestRoute";
|
||||
import { getBestRoute } from "@snk/solver/getBestRoute";
|
||||
import { createSvg } from "../svg-creator";
|
||||
import { grid, snake } from "./sample";
|
||||
import { drawOptions } from "./canvas";
|
||||
import { getPathToPose } from "@snk/compute/getPathToPose";
|
||||
import { getPathToPose } from "@snk/solver/getPathToPose";
|
||||
|
||||
const chain = getBestRoute(grid, snake);
|
||||
chain.push(...getPathToPose(chain.slice(-1)[0], snake)!);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@snk/demo",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@snk/compute": "1.0.0",
|
||||
"@snk/solver": "1.0.0",
|
||||
"@snk/draw": "1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user