public class SeaCowPuzzle
extends java.lang.Object
Constructor and Description |
---|
SeaCowPuzzle(java.util.Scanner fileScnr)
Creates a puzzle out of a puzzle input file
|
Modifier and Type | Method and Description |
---|---|
char[][] |
getCurrentlyRevealedGrid()
Returns a char array returning the current grid that should be displayed,
given the calls to setSquare() by this point.
|
char[][] |
getFinalGridWithErrors()
Returns a char array returning the grid that would be displayed to a player
who filled up the entire grid, given the calls to setSquare() by this point.
|
char[][] |
getFullyRevealedGrid()
Returns a char array of the fully revealed grid (akin to the answer key)
|
void |
resetToStartingState()
Resets the grid to how it would look when originally loaded
in from a file
|
void |
setSquare(int row,
int col,
java.lang.String markerToPlace)
Sets a square to either 's' for ship or 'w' for water.
|
void |
setSquare(java.lang.String letterCoords,
java.lang.String markerToPlace)
Sets a square to either 's' for ship or 'w' for water.
|
java.lang.String |
toString()
Returns the correct printout of a grid at this point in time, with hints
and legend.
|
public SeaCowPuzzle(java.util.Scanner fileScnr)
public void resetToStartingState()
public void setSquare(int row, int col, java.lang.String markerToPlace)
row
- 0th row is at the top, 5th row is the bottomcol
- 0th column is the left, 5th column is on the rightmarkerToPlace
- must be 's' or 'w'public void setSquare(java.lang.String letterCoords, java.lang.String markerToPlace)
letterCoords
- character string such as "a,g" or "a,l"markerToPlace
- must be 's' or 'w'public char[][] getFullyRevealedGrid()
public char[][] getCurrentlyRevealedGrid()
public char[][] getFinalGridWithErrors()
public java.lang.String toString()
toString
in class java.lang.Object