From 2647c097f4ec27551839c5d7cbd62a8d9b328710 Mon Sep 17 00:00:00 2001 From: sketchysoymilk <143027784+sketchysoymilk@users.noreply.github.com> Date: Mon, 29 Apr 2024 22:39:40 -0700 Subject: [PATCH] Update LightBoard.java --- src/main/java/LightBoard.java | 46 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/src/main/java/LightBoard.java b/src/main/java/LightBoard.java index 656e0c8..6e33dd9 100644 --- a/src/main/java/LightBoard.java +++ b/src/main/java/LightBoard.java @@ -29,33 +29,25 @@ public LightBoard(int numRows, int numCols) */ public boolean evaluateLight(int row, int col) { - int numOn = 0; -for (int r = 0; r < lights.length; r++) -{ - -if (lights[r][col]) -{ - -numOn++; - -} -} - -if (lights[row][col] && numOn % 2 == 0) -{ - -return false; - -} -if (!lights[row][col] && numOn % 3 == 0) -{ - -return true; - -} -return lights[row][col]; - - + int sum = 0; + if(lights[row][col] == true){ + for(int r = 0; r