Валерий Алексеевич Жарков

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


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

= "E"

      End If

      If str(2) = "e" Then

      Chr17.Text = "E"

      End If

      If str(3) = "e" Then

      Chr16.Text = "E"

      End If

      If str(4) = "e" Then

      Chr15.Text = "E"

      End If

      If str(5) = "e" Then

      Chr14.Text = "E"

      End If

      If str(6) = "e" Then

      Chr13.Text = "E"

      End If

      If str(7) = "e" Then

      Chr12.Text = "E"

      End If

      If str(8) = "e" Then

      Chr11.Text = "E"

      End If

      If str(9) = "e" Then

      Chr10.Text = "E"

      End If

      If str(10) = "e" Then

      Chr9.Text = "E"

      End If

      If str(11) = "e" Then

      Chr8.Text = "E"

      End If

      If str(12) = "e" Then

      Chr7.Text = "E"

      End If

      If str(13) = "e" Then

      Chr6.Text = "E"

      End If

      If str(14) = "e" Then

      Chr5.Text = "E"

      End If

      If str(15) = "e" Then

      Chr4.Text = "E"

      End If

      If str(16) = "e" Then

      Chr3.Text = "E"

      End If

      If str(17) = "e" Then

      Chr2.Text = "E"

      End If

      If str(18) = "e" Then

      Chr1.Text = "E"

      End If

      ElseIf Word_in.TextLength = 20 Then

      If str(0) = "e" Then

      Chr20.Text = "E"

      End If

      If str(1) = "e" Then

      Chr19.Text = "E"

      End If

      If str(2) = "e" Then

      Chr18.Text = "E"

      End If

      If str(3) = "e" Then

      Chr17.Text = "E"

      End If

      If str(4) = "e" Then

      Chr16.Text = "E"

      End If

      If str(5) = "e" Then

      Chr15.Text = "E"

      End If

      If str(6) = "e" Then

      Chr14.Text = "E"

      End If

      If str(7) = "e" Then

      Chr13.Text = "E"

      End If

      If str(8) = "e" Then

      Chr12.Text = "E"

      End If

      If str(9) = "e" Then

      Chr11.Text = "E"

      End If

      If str(10) = "e" Then

      Chr10.Text = "E"

      End If

      If str(11) = "e" Then

      Chr9.Text = "E"

      End If

      If str(12) = "e" Then

      Chr8.Text = "E"

      End If

      If str(13) = "e" Then

      Chr7.Text = "E"

      End If

      If str(14) = "e" Then

      Chr6.Text = "E"

      End If

      If str(15) = "e" Then

      Chr5.Text = "E"

      End If

      If str(16) = "e" Then

      Chr4.Text = "E"

      End If

      If str(17) = "e" Then

      Chr3.Text = "E"

      End If

      If str(18) = "e" Then

      Chr2.Text = "E"

      End If

      If str(19) = "e" Then

      Chr1.Text = "E"

      End If

      End If

      If InStr(Word_in.Text, "e", CompareMethod.Text) = 0 Then

      If f_chr1.Text = "" Then

      f_chr1.Text = "E"

      ElseIf f_chr2.Text = "" Then

      f_chr2.Text = "E"

      ElseIf f_chr3.Text = "" Then

      f_chr3.Text = "E"

      ElseIf f_chr4.Text = "" Then

      f_chr4.Text = "E"

      ElseIf f_chr5.Text = "" Then

      f_chr5.Text = "E"

      ElseIf f_chr6.Text = "" Then

      f_chr6.Text = "E"

      ElseIf f_chr7.Text = "" Then

      f_chr7.Text = "E"

      ElseIf f_chr8.Text = "" Then

      f_chr8.Text = "E"

      ElseIf f_chr9.Text = "" Then

      f_chr9.Text = "E"

      ElseIf f_chr10.Text = "" Then

      f_chr10.Text = "E"

      ElseIf f_chr11.Text = "" Then

      f_chr11.Text = "E"

      End If

      End If

      End Sub

      Дважды щёлкаем по кнопке Button с именем Name для 6-й буквы F. Появившийся шаблон метода после записи нашего кода принимает следующий вид.

      Листинг 19.7. Метод-обработчик щелчка кнопки.

      Private Sub F_Click(ByVal sender As System.Object, _

      ByVal e As System.EventArgs) Handles F.Click

      F.Enabled = False

      nums = Len(Word_in.Text)

      Try

      str(0) = Mid(Word_in.Text, nums, 1)

      str(1) = Mid(Word_in.Text, nums – 1, 1)

      str(2) = Mid(Word_in.Text, nums – 2, 1)

      str(3) = Mid(Word_in.Text, nums – 3, 1)

      str(4) = Mid(Word_in.Text, nums – 4, 1)

      str(5) = Mid(Word_in.Text, nums – 5, 1)

      str(6) = Mid(Word_in.Text, nums – 6, 1)

      str(7) = Mid(Word_in.Text, nums – 7, 1)

      str(8)