From d287a6d4be4bfb51eeb5db4142ed846e9e85b6dc Mon Sep 17 00:00:00 2001 From: cdez Date: Sun, 19 Jan 2025 12:41:59 -0700 Subject: [PATCH] Modified the Boggle project, made a bit more efficient. Not sure how to turn this in though. --- Boggle/02_test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Boggle/02_test.py b/Boggle/02_test.py index 2e718b3..b88bd8b 100644 --- a/Boggle/02_test.py +++ b/Boggle/02_test.py @@ -15,16 +15,13 @@ def printBoard(boardInput): def possibleMoves(inputCoords, boardInput): maxLen = len(boardInput) - 1 moveList = [] - # possible moves: (x+1, y), (x-1, y), (x, y+1), (x, y-1), (x+1, y+1), (x-1, y-1), (x+1, y-1), (x-1, y+1) possibleMoves = [(1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)] - for move in possibleMoves: newX = inputCoords[0] + move[0] newY = inputCoords[1] + move[1] if (0 <= newX <= maxLen) and (0 <= newY <= maxLen): moveList.append((newX, newY)) - print(moveList) # return moveList