-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSeed.java
30 lines (26 loc) · 911 Bytes
/
Seed.java
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
import java.util.ArrayList;
public class Seed {
private ArrayList<ArrayList<Integer>> coords = new ArrayList<ArrayList<Integer>>();
private ArrayList<Integer> rowValues = new ArrayList<Integer>();
private ArrayList<Integer> colValues = new ArrayList<Integer>();
public Seed() {
coords.add(rowValues);
coords.add(colValues);
}
public void add(int row, int col) {
coords.get(0).add(row);
coords.get(1).add(col);
}
public boolean get(int row, int col) {
boolean rowBool = false;
boolean colBool = false;
for (int i = 0; i < coords.get(1).size(); i++) {
if (coords.get(0).get(i) == row) rowBool = true;
if (coords.get(1).get(i) == col) colBool = true;
if (rowBool && colBool) return true;
rowBool = false;
colBool = false;
}
return false;
}
}