Make the board argument an array of any type.

This commit is contained in:
Oliver-Akins 2022-01-09 00:30:29 -06:00
parent b109c0d082
commit ec37881de7

View file

@ -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) {