Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 6: Программирование на Visual Basic искусственного интеллекта. Продолжение 2. Валерий Алексеевич Жарков

Читать онлайн книгу.

Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 6: Программирование на Visual Basic искусственного интеллекта. Продолжение 2 - Валерий Алексеевич Жарков


Скачать книгу
i < (pos \ 9) * 9 + 9

      If MPBoxes(i).MPIndex = type Then

      endpos += 1

      count = endpos – startpos

      Else

      If count > 4 Then

      While MPBoxes(pos).MPState = _

      BallState.ZOOMING_BALL

      Application.DoEvents()

      End While

      For j As Integer = 0 To count – 1

      MPBoxes(startpos + j).Destroy()

      Next

      Return count

      End If

      If i >= (pos \ 9) * 9 + 5 Then

      Return count

      End If

      startpos = i + 1

      endpos = i + 1

      End If

      i += 1

      End While

      If count > 4 Then

      While MPBoxes(pos).MPState = BallState.ZOOMING_BALL

      Application.DoEvents()

      End While

      For j As Integer = 0 To count – 1

      MPBoxes(startpos + j).Destroy()

      Next

      Return count

      End If

      End Function

      Private Function CheckVer(ByVal pos As Integer) As Integer

      Dim type As Integer = MPBoxes(pos).MPIndex

      Dim i As Integer = pos Mod 9

      Dim count As Integer

      Dim startpos As Integer = i

      Dim endpos As Integer = i

      While i < (pos Mod 9) + 73

      If MPBoxes(i).MPIndex = type Then

      endpos += 9

      count = (endpos – startpos) / 9

      Else

      If count > 4 Then

      While MPBoxes(pos).MPState = _

      BallState.ZOOMING_BALL

      Application.DoEvents()

      End While

      For j As Integer = 0 To count – 1

      MPBoxes(startpos + j * 9).Destroy()

      Next

      Return count

      End If

      If i >= (pos Mod 9) + 36 Then

      Return count

      End If

      startpos = i + 9

      endpos = i + 9

      End If

      i += 9

      End While

      If count > 4 Then

      While MPBoxes(pos).MPState = BallState.ZOOMING_BALL

      Application.DoEvents()

      End While

      For j As Integer = 0 To count – 1

      MPBoxes(startpos + j * 9).Destroy()

      Next

      Return count

      End If

      End Function

      Private Function CheckLR(ByVal pos As Integer) As Integer

      If pos = 5 Or pos = 6 Or pos = 7 Or pos = 8 Or pos = 15 _

      Or pos = 16 Or pos = 17 _

      Or pos = 25 Or pos = 26 Or pos = 35 Or pos = 45 _

      Or pos = 54 Or pos = 55 _

      Or pos = 63 Or pos = 64 Or pos = 65 Or pos = 72 _

      Or pos = 73 Or pos = 74 Or pos = 75 Then

      Return 0

      End If

      Dim type As Integer = MPBoxes(pos).MPIndex

      Dim i As Integer = pos Mod 10

      i = IIf(i = 8, 18, IIf(i = 7, 27, IIf(i = 6, 36, i)))

      Dim count As Integer

      Dim startpos As Integer = i

      Dim endpos As Integer = i

      Dim tempi As Integer = i + 1

      Dim temp As Integer

      If i < 9 Then

      temp = 9 – i

      Else

      temp = 9 – (i \ 9)

      End If

      While i < tempi + (temp – 1) * 10

      If MPBoxes(i).MPIndex = type Then

      endpos += 10

      count = (endpos – startpos) \ 10

      Else

      If count > 4 Then

      While MPBoxes(pos).MPState = _

      BallState.ZOOMING_BALL

      Application.DoEvents()

      End While

      For j As Integer = 0 To count – 1

      MPBoxes(startpos + j * 10).Destroy()

      Next

      Return count

      End If

      If i >= pos + 40 Then

      Return count

      End If

      startpos = i + 10

      endpos = i + 10

      End If

      i += 10

      End While

      If count > 4 Then

      While MPBoxes(pos).MPState = BallState.ZOOMING_BALL

      Application.DoEvents()

      End While

      For j As Integer = 0 To count – 1

      MPBoxes(startpos + j * 10).Destroy()

      Next

      Return count

      End If

      End Function

      Private Function CheckRL(ByVal pos As Integer) As Integer

      If pos = 0 Or pos = 1 Or pos = 2 Or pos = 3 Or pos = 9 _

      Or pos = 10 Or pos = 11 _

      Or pos = 18 Or pos = 19 Or pos = 27 Or pos = 53 _

      Or pos = 61 Or pos = 62 _

      Or pos = 69 Or pos = 70 Or pos = 71 Or pos = 77 _

      Or pos = 78 Or pos = 79 Or pos = 80 Then

      Return 0

      End If

      Dim type As Integer = MPBoxes(pos).MPIndex

      Dim i As Integer = pos Mod 8

      If i = 0 Then

      i = 8

      ElseIf i < 4 Then

      i = (i + 1) * 8 + i

      ElseIf pos \ 8 >= 5 Then

      i = 45

      End If

      Dim count As Integer

      Dim startpos As Integer = i

      Dim endpos As Integer = i

      Dim tempi As Integer = i + 1

      Dim temp As Integer

      If i < 9 Then

      temp = i + 1

      Else

      temp


Скачать книгу