From ec37881de75c66de367c81463ffe13c93902cf08 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 9 Jan 2022 00:30:29 -0600 Subject: [PATCH] Make the board argument an array of any type. --- common/src/algorithms/movementDirection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/algorithms/movementDirection.ts b/common/src/algorithms/movementDirection.ts index d9f0dda..2164ca4 100644 --- a/common/src/algorithms/movementDirection.ts +++ b/common/src/algorithms/movementDirection.ts @@ -8,7 +8,7 @@ * @returns An object containing the number of ships that are on each side of * the target ship */ -function countShips(board: string[], shipLocation: number) { +function countShips(board: any[], shipLocation: number) { return { left: board.slice(1, shipLocation - 1).filter(x => x != null).length, right: board.slice(shipLocation + 1).filter(x => x != null).length, @@ -27,7 +27,7 @@ function countShips(board: string[], shipLocation: number) { * - `0` = Not moving * - `1` = Towards the Warp Gate */ -export function determineDirection(board: string[], shipLocation: number) { +export function determineDirection(board: any[], shipLocation: number) { let delta = 1; while (true) {