-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBingoCard.java
58 lines (37 loc) · 1.17 KB
/
BingoCard.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import java.lang.reflect.Array;
import java.util.ArrayList;
public class BingoCard {
private Array[][] bla;
private ArrayList<ArrayList<Integer>> number_field;
private ArrayList<ArrayList<Integer>> goals_per_card;
public BingoCard(){
number_field = new ArrayList<>();
goals_per_card = new ArrayList<>();
bla = new Array[5][5];
}
public void addColumn(ArrayList<Integer> col){
if(col == null) throw new NullPointerException();
number_field.add(col);
}
public void convertCard(){
if(number_field.size() != 5 )throw new IndexOutOfBoundsException();
for(int i = 0;i < 5; i++){
bla[i] = (Array[]) number_field.get(i).toArray();
}
System.out.println("Array" + bla.toString());
}
public void toCard(){
for(ArrayList<Integer> x : number_field){
for(Integer y : x){
System.out.print(y + " ");
}
System.out.println();
}
}
//gewinnkombinationen pro Karte
public void createGoals(){
for(ArrayList<Integer> a : number_field){
goals_per_card.add(a);
}
}
}