Оценить:
 Рейтинг: 0

Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 2: Программирование на Visual C# искусственного интеллекта (продолжение 1)

Год написания книги
2022
<< 1 ... 10 11 12 13 14 15 16 17 >>
На страницу:
14 из 17
Настройки чтения
Размер шрифта
Высота строк
Поля
if (((x – 3)> -1) && ((y +3) <6))
{
if (arr [x – 3, y +3] == cpu) d1++;
}
}
}
}
}
if (((x – 1)> -1) && ((y – 1)> -1))
{
if (arr [x – 1, y – 1] == cpu)
{
d2++;
if (((x – 2)> -1) && ((y – 2)> -1))
{
if (arr [x – 2, y – 2] == cpu)
{
d2++;
if (((x – 3)> -1) && ((y – 3)> -1))
{
if (arr [x – 3, y – 3] == cpu) d2++;
}
}
}
}
}
if (((x +1) <7) && ((y +1) <6))
{
if (arr [x +1, y +1] == cpu)
{
d2++;
if (((x +2) <7) && ((y +2) <6))
{
if (arr [x +2, y +2] == cpu)
{
d2++;
if (((x +3) <7) && ((y +3) <6))
{
if (arr [x +3, y +3] == cpu) d2++;
}
}
}
}
}
if ((y – 1)> -1) if (arr [x, y – 1] == cpu)
{
d0++;
if ((y – 2)> -1) if (arr [x, y – 2] == cpu)
{
d0++;
if ((y – 3)> -1)
if (arr [x, y – 3] == cpu) d0++;
}
}
if (x – 1> -1)
{
if (arr [x – 1, y] == cpu)
{
d3++;
if (x – 2> -1)
{
if (arr [x – 2, y] == cpu)
{
d3++;
if (x – 3> -1)
if (arr [x – 3, y] == cpu) d3++;
}
}
}
}
if (x +1 <7)
{
if (arr [x +1, y] == cpu)
{
d3++;
if (x +2 <7)
{
if (arr [x +2, y] == cpu)
{
d3++;
if (x +3 <7)
if (arr [x +3, y] == cpu) d3++;
}
}
}
}
max = d0;
if (d1> max) max = d1;
if (d2> max) max = d2;
if (d3> max) max = d3;
if (max == 2) score = score +5;
if (max> 2)
{
score = score +71; thn [x, y] = cpu;
if ((d1 <3) && (d2 <3) && (d3 <3))
score = score – 10;
}
if (((x +1) <7) && ((y – 1)> -1))
{
if (arr [x +1, y – 1] == plr)
<< 1 ... 10 11 12 13 14 15 16 17 >>
На страницу:
14 из 17