-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoardTestViewer.java
More file actions
34 lines (29 loc) · 893 Bytes
/
BoardTestViewer.java
File metadata and controls
34 lines (29 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.ArrayList;
public class BoardTestViewer {
Board board;
public BoardTestViewer(Board b)
{
board = b;
}
public void showBoard()
{
Peg[][] pegs = board.getGrid().getAllPegs();
for(Peg[] row: pegs)
{
for (Peg peg: row) {
ArrayList<Bead> beads = peg.getAllBeads();
int maxNumber= beads.size();
String[] XChange = {"A","B","C","D"};
System.out.print(XChange[peg.getXCoord()] + peg.getYCoord() + ": ");
for (Bead bead: beads)
{
if(bead.getColour()==Colour.WHITE)
System.out.print("W");
else
System.out.print("B");
}
System.out.println("");
}
}
}
}