-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGame.java
More file actions
49 lines (39 loc) · 852 Bytes
/
Game.java
File metadata and controls
49 lines (39 loc) · 852 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class Game {
Cards cards;
private ArrayList<Card> deck0,deck1,deck2;
public Game() {
cards=new Cards();
deck0=new ArrayList<Card>();//place to put card on the floor
deck1=new ArrayList<Card>();
deck2=new ArrayList<Card>();
for(int i=0;i<26;i++) {
deck1.add(cards.pop());
deck2.add(cards.pop());
}
}
ArrayList<Card> returnDeck0(){
return deck0;
}
ArrayList<Card> returnDeck1(){
return deck1;
}
ArrayList<Card> returnDeck2(){
return deck2;
}
void show1() {
System.out.println("p1");
System.out.println(deck1);
}
void show2() {
System.out.println("p2");
System.out.println(deck2);
}
void show0() {
System.out.println("cards on the floor");
System.out.println(deck0);
}
}