-
Notifications
You must be signed in to change notification settings - Fork 0
/
Avatar.java
62 lines (61 loc) · 953 Bytes
/
Avatar.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
59
60
61
62
import java.util.*;
public class Avatar {
private Random rnd = new Random();
private int[] Güc = new int[5];
private int[] Tür = new int[5];
private String[] Karakter = new String[5];
/**
*
* @return random number
*/
private int GücUret()
{
return rnd.nextInt(2,11);
}
/**
*
* @return random number
*/
private int TürUret()
{
return rnd.nextInt(2);
}
/**
* @param make variables
*/
public void AvatarUret()
{
for(int i=0;i<5;i++)
{
Güc[i] = GücUret();
Tür[i] = TürUret();
}
}
/**
* show variables
*/
public void AvatarGoster()
{
String Temp;
for(int i=0;i<5;i++)
{
Temp = (Tür[i]>0) ? "Savaşçı" : "Çiftçi";
Karakter[i] = Temp + " " + String.valueOf(Güc[i]);
System.out.println(Karakter[i]);
}
}
/*
* @return variables
*/
public int getGüc(int i)
{
return Güc[i];
}
/*
* @return variables
*/
public int getTür(int i)
{
return Tür[i];
}
}