-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeste.java
More file actions
53 lines (51 loc) · 1.03 KB
/
Deste.java
File metadata and controls
53 lines (51 loc) · 1.03 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
import java.util.Random;
public class Deste extends Kart{
protected int RandI;
protected int RandJ;
private Random rnd = new Random();
protected String[][] KartlarTemp = new String[4][13];
/**
* @return 0-3 random number
*/
public int SayiUretI()
{
RandI = rnd.nextInt(4);
return RandI;
}
/**
* @return 0-12 random number
*/
public int SayiUretJ()
{
RandJ = rnd.nextInt(13);
return RandJ;
}
/**
* @param tempI random number
* @param tempJ random number
* @param tempFirstI random number
* @param tempFirstj random number
*
* and swap
*/
public void DesteKarýstýr()
{
int tempI = SayiUretI();
int tempJ = SayiUretJ();
int tempFirstI = SayiUretI();
int tempFirstJ = SayiUretJ();
KartlarTemp[tempI][tempJ] = Kartlar[tempI][tempJ];
Kartlar[tempI][tempJ] = Kartlar[tempFirstI][tempFirstJ];
Kartlar[tempFirstI][tempFirstJ] = KartlarTemp[tempI][tempJ];
}
public void DesteGoster()
{
for(int i=0;i<4;i++)
{
for(int j=0;j<13;j++)
{
System.out.println(Kartlar[i][j]);
}
}
}
}