generated from Flashky/advent-of-code-yyyy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.adventofcode.flashk.day21; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
public class Cell { | ||
|
||
private static final char ROCK = '#'; | ||
private static final char GARDEN_PLOT = '.'; | ||
|
||
private final int row; | ||
private final int col; | ||
private final char value; | ||
|
||
@Setter | ||
private boolean visited = false; | ||
|
||
@Setter | ||
private int step = 0; | ||
|
||
public Cell(int row, int col, char value) { | ||
this.row = row; | ||
this.col = col; | ||
this.value = (value == 'S') ? GARDEN_PLOT : value; | ||
} | ||
|
||
public boolean isRock() { | ||
return value == ROCK; | ||
} | ||
|
||
public boolean isEven() { | ||
return step % 2 == 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters