-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardClass.java
More file actions
104 lines (100 loc) · 1.85 KB
/
CardClass.java
File metadata and controls
104 lines (100 loc) · 1.85 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
public class CardClass
{
private int hand_num = 0;
private int hand_suite = 0;
private String card_s = "";
private String suite_name = "";
///////////////////////////////////////
public String number ()
{
hand_num = ((int)(Math.random()*13+1));
if (hand_num == 1)
{
card_s = Integer.toString(hand_num);
card_s = "Ace";
}
if (hand_num == 2)
{
card_s = Integer.toString(hand_num);
card_s = "2";
}
if (hand_num == 3)
{
card_s = Integer.toString(hand_num);
card_s = "3";
}
if (hand_num == 4)
{
card_s = Integer.toString(hand_num);
card_s = "4";
}
if (hand_num == 5)
{
card_s = Integer.toString(hand_num);
card_s = "5";
}
if (hand_num == 6)
{
card_s = Integer.toString(hand_num);
card_s = "6";
}
if (hand_num == 7)
{
card_s = Integer.toString(hand_num);
card_s = "7";
}
if (hand_num == 8)
{
card_s = Integer.toString(hand_num);
card_s = "8";
}
if (hand_num == 9)
{
card_s = Integer.toString(hand_num);
card_s = "9";
}
if (hand_num == 10)
{
card_s = Integer.toString(hand_num);
card_s = "10";
}
if (hand_num == 11)
{
card_s = Integer.toString(hand_num);
card_s = "King";
}
if (hand_num == 12)
{
card_s = Integer.toString(hand_num);
card_s = "Queen";
}
if (hand_num == 13)
{
card_s = Integer.toString(hand_num);
card_s = "Jack";
}
return (card_s);
}
///////////////////////////////////////
public String suite ()
{
hand_suite = ((int)(Math.random()*4+1));
if (hand_suite == 1)
{
suite_name = "Spades";
}
if (hand_suite == 2)
{
suite_name = "Diamonds";
}
if (hand_suite == 3)
{
suite_name = "Hearts";
}
if (hand_suite == 4)
{
suite_name = "Clubs";
}
return (suite_name);
}
}