-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray_slot.java
59 lines (48 loc) · 1.29 KB
/
array_slot.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
import java.util.Random;
public class Main
{
public static void main (String[] args)
{
int[] slots;
slots = new int[11];
int max = slots.length;
Random rand = new Random();
while (true)
{
System.out.print("\033[H\033[2J");
System.out.flush();
for(int i: slots)
{
slots[i] = rand.nextInt(9);
}
for (int i = 0; i < max; i++)
System.out.print("╔═══════╗");
System.out.println();
for (int i = 0; i < max; i++)
System.out.print("║ ║");
System.out.println();
for (int i = 0; i < max; i++)
System.out.print("║ "+" " +" "+slots[i]+" "+" "+" ║");
System.out.println();
for (int i = 0; i < max; i++)
System.out.print("║ ║");
System.out.println();
for (int i = 0; i < max; i++)
System.out.print("╚═══════╝");
System.out.println();
if (slots[0] == slots[1])
{
System.out.println("f1 = f2");
if (slots[1] == slots[2])
System.out.println("f1 = f2 = f3");
else
System.out.println("f1 = f2 != f3");
}
else
{
System.out.println("f1 != f2");
}
try{Thread.sleep(200);}catch(InterruptedException e){System.out.println(e);}
}
}
}