⬆️ update prettier

This commit is contained in:
platane
2025-02-20 19:58:59 +07:00
parent 79c252356c
commit ace186c41f
41 changed files with 94 additions and 94 deletions

View File

@@ -17,7 +17,7 @@ for (const { width, height, snake } of [
{ width: 5, height: 5, snake: snake4 },
])
it(`should find solution for ${n} ${width}x${height} generated grids for ${getSnakeLength(
snake
snake,
)} length snake`, () => {
const results = Array.from({ length: n }, (_, seed) => {
const grid = createFromSeed(seed, width, height);

View File

@@ -24,7 +24,7 @@ export const clearCleanColoredLayer = (
grid: Grid,
outside: Outside,
snake0: Snake,
color: Color
color: Color,
) => {
const snakeN = getSnakeLength(snake0);
@@ -55,7 +55,7 @@ const getPathToNextPoint = (
grid: Grid,
snake0: Snake,
color: Color,
points: Point[]
points: Point[],
) => {
const closeList: Snake[] = [];
const openList: M[] = [{ snake: snake0 } as any];
@@ -96,7 +96,7 @@ export const getTunnellablePoints = (
grid: Grid,
outside: Outside,
snakeN: number,
color: Color
color: Color,
) => {
const points: Point[] = [];

View File

@@ -20,7 +20,7 @@ export const clearResidualColoredLayer = (
grid: Grid,
outside: Outside,
snake0: Snake,
color: Color
color: Color,
) => {
const snakeN = getSnakeLength(snake0);
@@ -99,7 +99,7 @@ export const getTunnellablePoints = (
grid: Grid,
outside: Outside,
snakeN: number,
color: Color
color: Color,
) => {
const points: T[] = [];

View File

@@ -13,7 +13,7 @@ export const getBestRoute = (grid0: Grid, snake0: Snake) => {
for (const color of extractColors(grid)) {
if (color > 1)
chain.unshift(
...clearResidualColoredLayer(grid, outside, chain[0], color)
...clearResidualColoredLayer(grid, outside, chain[0], color),
);
chain.unshift(...clearCleanColoredLayer(grid, outside, chain[0], color));
}

View File

@@ -37,7 +37,7 @@ const getSnakeEscapePath = (
grid: Grid,
outside: Outside,
snake0: Snake,
color: Color
color: Color,
) => {
const openList: M[] = [{ snake: snake0, w: 0 } as any];
const closeList: Snake[] = [];
@@ -79,7 +79,7 @@ export const getBestTunnel = (
x: number,
y: number,
color: Color,
snakeN: number
snakeN: number,
) => {
const c = { x, y };
const snake0 = createSnakeFromCells(Array.from({ length: snakeN }, () => c));

View File

@@ -24,7 +24,7 @@ export const createOutside = (grid: Grid, color: Color = 0 as Color) => {
export const fillOutside = (
outside: Outside,
grid: Grid,
color: Color = 0 as Color
color: Color = 0 as Color,
) => {
let changed = true;
while (changed) {

View File

@@ -27,7 +27,7 @@ export const getTunnelPath = (snake0: Snake, tunnel: Point[]) => {
export const updateTunnel = (
grid: Grid,
tunnel: Point[],
toDelete: Point[]
toDelete: Point[],
) => {
while (tunnel.length) {
const { x, y } = tunnel[0];