From 7cec47ef457bed5f72b05c4d3318bb5677473901 Mon Sep 17 00:00:00 2001 From: RabbitHash5390 Date: Thu, 26 Sep 2024 19:18:32 -0400 Subject: [PATCH] Update client-b.txt --- client-b.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/client-b.txt b/client-b.txt index 991004f..f1987a4 100644 --- a/client-b.txt +++ b/client-b.txt @@ -1,4 +1,30 @@ # Client Task B # # Add your pseudocode to this file below this line: # # ------------------------------------------------- # +BEGIN WarehouseApp + DEFINE WAREHOUSE as a 2D grid (e.g., [['A1', 'A2'], ['B1', 'B2']]) + FUNCTION findPath(start, target) + SET currentPosition = start + WHILE currentPosition NOT EQUAL target DO + PRINT "You are at " + currentPosition + PRINT "Move (N/S/E/W):" + READ move + UPDATE currentPosition BASED ON move + IF currentPosition OUT OF BOUNDS THEN + PRINT "Invalid move. Try again." + SET currentPosition BACK TO previous position + END IF + END WHILE + PRINT "You reached: " + target + END FUNCTION + FUNCTION main() + PRINT "Enter starting position:" + READ startPosition + PRINT "Enter target position:" + READ targetPosition + CALL findPath(startPosition, targetPosition) + END FUNCTION + CALL main() +END WarehouseApp +