Professional Documents
Culture Documents
ura:
Lenguajes y autmatas I
Docent
e:
Trabajo:
Ing.
Jess
Mquina
de Turing
leo villa
Alumno 15Noviem
s:
Cinthya
breEstefan
Semest2014
re y Nuevo
ISC5BV.
Lugar
Grupo:yCasas
Fecha:
Grande
s,
Chihuah
ua.
Mquina De Turing
Problema
Resultado
Aqui declare las variables que utilizare txts son los nuevos textbox que ponder igualmente
los combs
Public Class Form1
Public txts(0, 0) As TextBox
Public combs(0) As ComboBox
Public conta1 As Integer = 0
Public conta2 As Integer = 1
Public npalabra As String = ""
Aqui haremos que al momento de darle clic al combobox aparezca la cantidad deseada,
tambin hice que se pusierasn los corchetes por eso esta una nueva posicin declarada
Private Sub Cmbox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Cmbox.SelectedIndexChanged
ReDim txts(Cmbox.Text - 1, 3)
ReDim combs(Cmbox.Text - 1)
Dim posy As Integer = 227
Dim posaa As Integer = 225
For i = 0 To Cmbox.Text - 1
txts(i, 0) = New TextBox
txts(i, 0).Location = New Point(78, posy)
txts(i, 0).Size = New Size(25, 20)
txts(i, 0).BackColor = Color.White
Me.Controls.Add(txts(i, 0))
Dim lbl1 As New Label
lbl1.Location = New Point(65, posy)
lbl1.Size = New Size(27, 25)
lbl1.Font = New Font("Arial", 14, FontStyle.Bold)
lbl1.Text = "{"
Me.Controls.Add(lbl1)
Dim lbl5 As New Label
lbl5.Location = New Point(161, posy)
lbl5.Size = New Size(27, 25)
lbl5.Font = New Font("Arial", 14, FontStyle.Bold)
lbl5.Text = "{"
Me.Controls.Add(lbl5)
txts(i, 1) = New TextBox
txts(i, 1).Location = New Point(113, posy)
txts(i, 1).Size = New Size(25, 20)
txts(i, 1).BackColor = Color.White
Me.Controls.Add(txts(i, 1))
txts(i, 2) = New TextBox
txts(i, 2).Location = New Point(188, posy)
txts(i, 2).Size = New Size(25, 20)
txts(i, 2).BackColor = Color.White
Me.Controls.Add(txts(i, 2))
txts(i, 3) = New TextBox
txts(i, 3).Location = New Point(220, posy)
txts(i, 3).Size = New Size(25, 20)
Modulo
Aqu es donde se hace los pasos que tiene que hacer declare y llame los txt del form1 para
que tomara lo que se a escrito en ellos
Module reglas
Public Sub checar()
Dim letras() As Char
letras = Form1.txtnum.Text.ToCharArray
Dim texto As String = Form1.txts(0, 0).Text
Dim pos As Char = letras(0)
Use un goto para que siguiera los pasos como dije tambin mande a llamar los txt que
estn en el form1 estas reglas son bsicas para poder elaborar el programa de la mquina
de Turing
1:
For i = 0 To letras.Length - 1
pos = letras(i)
If pos = Form1.txts(0, 1).Text And Form1.txts(0, 0).Text = texto Then
Form1.npalabra = Form1.npalabra & Form1.txts(0, 3).Text
texto = Form1.txts(0, 2).Text
If Form1.combs(0).SelectedItem = "I" Then
GoTo 1
End If
2:
3:
4:
5:
End Sub