From 451ae4f7448dc6640fd1a4a86f401cc196a80ecc Mon Sep 17 00:00:00 2001 From: muktar1907 Date: Tue, 23 Apr 2024 17:10:31 -0500 Subject: [PATCH 1/2] fix tests for 35x35 grid --- html/index.html | 32 +++++++++++++++++++++---- src/main/java/uta/cse3310/Game.java | 6 ++--- src/test/java/uta/cse3310/gameTest.java | 8 +++---- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/html/index.html b/html/index.html index 115d912..3bf0506 100644 --- a/html/index.html +++ b/html/index.html @@ -57,7 +57,7 @@

The Word Search Game

diff --git a/src/main/java/uta/cse3310/Game.java b/src/main/java/uta/cse3310/Game.java index 134e0ff..57ca6ac 100644 --- a/src/main/java/uta/cse3310/Game.java +++ b/src/main/java/uta/cse3310/Game.java @@ -76,7 +76,7 @@ public void setGameStatus(boolean gameStatus) { public void startGame() { displayRules(); // gridField=new GridField(wordList); - gridField.generateGrid(50); + gridField.generateGrid(36); gameStatus = true; } @@ -98,8 +98,8 @@ public void updateGame(ArrayList attempt) { while (i.hasNext()) { UserEvent U = (UserEvent) i.next(); int index = U.cell; - int row = index / 50; - int column = index % 50; + int row = index / 35; + int column = index % 35; word = word + grid[row][column]; System.out.println(word); diff --git a/src/test/java/uta/cse3310/gameTest.java b/src/test/java/uta/cse3310/gameTest.java index a407e6b..c4fe749 100644 --- a/src/test/java/uta/cse3310/gameTest.java +++ b/src/test/java/uta/cse3310/gameTest.java @@ -144,16 +144,16 @@ public void testUpdate() UserEvent U4= new UserEvent(); UserEvent U5= new UserEvent(); U1.player=player1; - U1.cell=50; + U1.cell=35; U1.action=0; U2.player=player1; - U2.cell=51; + U2.cell=36; U2.action=1; U3.player=player1; - U3.cell=52; + U3.cell=37; U3.action=1; U4.player=player1; - U4.cell=53; + U4.cell=38; U4.action=2; ArrayList attempt = new ArrayList(){ { From 09e9dd0819c4f9896fa5c28d408abb48d8496bc1 Mon Sep 17 00:00:00 2001 From: muktar1907 Date: Tue, 23 Apr 2024 17:13:10 -0500 Subject: [PATCH 2/2] 35x35 grid --- src/main/java/uta/cse3310/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/uta/cse3310/Game.java b/src/main/java/uta/cse3310/Game.java index 57ca6ac..d3cf0b5 100644 --- a/src/main/java/uta/cse3310/Game.java +++ b/src/main/java/uta/cse3310/Game.java @@ -76,7 +76,7 @@ public void setGameStatus(boolean gameStatus) { public void startGame() { displayRules(); // gridField=new GridField(wordList); - gridField.generateGrid(36); + gridField.generateGrid(35); gameStatus = true; }