forked from Vladislav00980/-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproverki
44 lines (42 loc) · 2.47 KB
/
proverki
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
System.out.print(a[i][j]+" ");
if(a[i][j].equals("x") && a[i][j + 1].equals("x") && a[i][j + 2].equals("x"))
{
System.out.println("крестики выйграли");break;
}
if(a[i][j].equals("x") && a[i + 1][j].equals("x") && a[i + 2][j].equals("x"))
{
System.out.println("крестики выйграли");break;
}
if(a[i][j].equals("x") && a[i + 1][j + 1].equals("x") && a[i + 2][j + 2].equals("x"))
{
System.out.println("крестики выйграли");break;
}
if(a[i][j].equals("o") && a[i][j + 1].equals("o") && a[i][j + 2].equals("o"))
{
System.out.println("нолики выйграли");break;
}
if(a[i][j].equals("o") && a[i + 1][j].equals("o") && a[i + 2][j].equals("o"))
{
System.out.println("нолики выйграли");break;
}
if(a[i][j].equals("o") && a[i + 1][j + 1].equals("o") && a[i + 2][j + 2].equals("o"))
{
System.out.println("нолики выйграли");break;
}
if(!a[i][j].equals("1") && !a[i + 1][j].equals("2") && !a[i + 2][j].equals("3") && !a[i][j + 1].equals("4") && !a[i + 1][j + 1].equals("5") && !a[i + 2][j + 1].equals("6") && !a[i][j + 2].equals("7") && !a[i + 1][j + 2].equals("8") && !a[i + 2][j + 2].equals("9"))
{
System.out.println("ничья");
break;
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(a[i][j].equals(a[i][j + 1]) && a[i][j + 1].equals(a[i][j + 2]))
{
System.out.println("выйграли");break;
}
if(a[i][j].equals(a[i + 1][j]) && a[i + 1][j].equals(a[i + 2][j]))
{
System.out.println("выйграли");break;
}
if(a[i][j].equals(a[i + 1][j + 1]) && a[i + 1][j + 1].equals(a[i + 2][j + 2]))
{
System.out.println("выйграли");break;