Skip to content

Commit

Permalink
Update LightBoard.java
Browse files Browse the repository at this point in the history
  • Loading branch information
willy2day authored Apr 30, 2024
1 parent 6e018e5 commit b08865d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/main/java/LightBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,14 @@ public boolean evaluateLight(int row, int col)
/* to be implemented in part (b) */
int p=0;
if (lights[row][col]==true){
for (int i=0; i<col;i++){
for (int i=0; i<row;i++){
if (lights[row][i]==true)
p++;}
if (p%2==0)
return false;}
else if (lights[row][col]==false){
for (int i=0; i<col;i++){
if (lights[row][i]==true)
p++;}
if (p%3==0)
return false;
else if (p%3==0)
return true;}
if (lights[row][col]==true)
return true;
return false;
return lights[row][col];
}


Expand Down

0 comments on commit b08865d

Please sign in to comment.