From dc510e00b074f59f345c70a87a1d1288405fae37 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Wed, 29 Jun 2022 22:22:01 -0600 Subject: [PATCH] Provide a fix for the failing test-case --- common/src/algorithms/movementDirection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/algorithms/movementDirection.ts b/common/src/algorithms/movementDirection.ts index 5760c1f..cc3ca05 100644 --- a/common/src/algorithms/movementDirection.ts +++ b/common/src/algorithms/movementDirection.ts @@ -64,7 +64,7 @@ export function determineDirection(board: any[], shipLocation: number) { while (true) { // The left side of the board is out of range, nearest ship is always // right - if (shipLocation - delta <= 0) { + if (shipLocation - delta < 0) { return 1; }