EDN Admin
Well-known member
I have made a working crossword game, however, being an EXTREME beginner in programming games such as these, i have had to make the very long winded way of using code like this;
Public Class Crossword
Dim Word1 As String
Dim Word2 As String
Dim Word3 As String
Dim Word4 As String
Dim Word5 As String
Dim Word6 As String
Dim Word7 As String
Dim Word8 As String
Dim Word9 As String
Dim Word10 As String
Dim Word11 As String
Dim Word12 As String
Private Sub NewGame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Word1 = "TANZEN"
Word2 = "RADFAHREN"
Word3 = "HELFEN"
Word4 = "EINKAUFEN"
Word5 = "MACHEN"
Word6 = "SCHWIMMEN"
Word7 = "KUCHEN"
Word8 = "FAULENZEN"
Word9 = "ESSEN"
Word10 = "SCHLAFEN"
Word11 = "TRAGEN"
Word12 = "GEHEN"
MsgBox("This is a crossword game about german verbs. The english verbs are given, and you have to write the german translation into the correct space. Ensure you write in capital letters.")
Button1.Text = "Check"
Button2.Text = "Back"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text & TextBox2.Text & TextBox3.Text & TextBox4.Text & TextBox5.Text & TextBox6.Text = Word1 Then
TextBox1.BackColor = Color.DarkSeaGreen
TextBox2.BackColor = Color.DarkSeaGreen
TextBox3.BackColor = Color.DarkSeaGreen
TextBox4.BackColor = Color.DarkSeaGreen
TextBox5.BackColor = Color.DarkSeaGreen
TextBox6.BackColor = Color.DarkSeaGreen
Else
TextBox1.BackColor = Color.PaleVioletRed
TextBox2.BackColor = Color.PaleVioletRed
TextBox3.BackColor = Color.PaleVioletRed
TextBox4.BackColor = Color.PaleVioletRed
TextBox5.BackColor = Color.PaleVioletRed
TextBox6.BackColor = Color.PaleVioletRed
End If
If TextBox7.Text & TextBox8.Text & TextBox9.Text & TextBox10.Text & TextBox2.Text & TextBox11.Text & TextBox12.Text & TextBox13.Text & TextBox14.Text = Word2 Then
TextBox7.BackColor = Color.DarkSeaGreen
TextBox8.BackColor = Color.DarkSeaGreen
TextBox9.BackColor = Color.DarkSeaGreen
TextBox10.BackColor = Color.DarkSeaGreen
TextBox2.BackColor = Color.DarkSeaGreen
TextBox11.BackColor = Color.DarkSeaGreen
TextBox12.BackColor = Color.DarkSeaGreen
TextBox13.BackColor = Color.DarkSeaGreen
TextBox14.BackColor = Color.DarkSeaGreen
Else
TextBox7.BackColor = Color.PaleVioletRed
TextBox8.BackColor = Color.PaleVioletRed
TextBox9.BackColor = Color.PaleVioletRed
TextBox10.BackColor = Color.PaleVioletRed
TextBox2.BackColor = Color.PaleVioletRed
TextBox11.BackColor = Color.PaleVioletRed
TextBox12.BackColor = Color.PaleVioletRed
TextBox13.BackColor = Color.PaleVioletRed
TextBox14.BackColor = Color.PaleVioletRed
End If
If TextBox15.Text & TextBox5.Text & TextBox16.Text & TextBox17.Text & TextBox18.Text & TextBox19.Text = Word3 Then
TextBox15.BackColor = Color.DarkSeaGreen
TextBox5.BackColor = Color.DarkSeaGreen
TextBox16.BackColor = Color.DarkSeaGreen
TextBox17.BackColor = Color.DarkSeaGreen
TextBox18.BackColor = Color.DarkSeaGreen
TextBox19.BackColor = Color.DarkSeaGreen
Else
TextBox15.BackColor = Color.PaleVioletRed
TextBox5.BackColor = Color.PaleVioletRed
TextBox16.BackColor = Color.PaleVioletRed
TextBox17.BackColor = Color.PaleVioletRed
TextBox18.BackColor = Color.PaleVioletRed
TextBox19.BackColor = Color.PaleVioletRed
End If
If TextBox18.Text & TextBox20.Text & TextBox21.Text & TextBox22.Text & TextBox23.Text & TextBox24.Text & TextBox25.Text & TextBox26.Text & TextBox27.Text = Word4 Then
TextBox18.BackColor = Color.DarkSeaGreen
TextBox20.BackColor = Color.DarkSeaGreen
TextBox21.BackColor = Color.DarkSeaGreen
TextBox22.BackColor = Color.DarkSeaGreen
TextBox23.BackColor = Color.DarkSeaGreen
TextBox24.BackColor = Color.DarkSeaGreen
TextBox25.BackColor = Color.DarkSeaGreen
TextBox26.BackColor = Color.DarkSeaGreen
TextBox27.BackColor = Color.DarkSeaGreen
Else
TextBox18.BackColor = Color.PaleVioletRed
TextBox20.BackColor = Color.PaleVioletRed
TextBox21.BackColor = Color.PaleVioletRed
TextBox22.BackColor = Color.PaleVioletRed
TextBox23.BackColor = Color.PaleVioletRed
TextBox24.BackColor = Color.PaleVioletRed
TextBox25.BackColor = Color.PaleVioletRed
TextBox26.BackColor = Color.PaleVioletRed
TextBox27.BackColor = Color.PaleVioletRed
End If
If TextBox28.Text & TextBox29.Text & TextBox30.Text & TextBox31.Text & TextBox32.Text & TextBox27.Text = Word5 Then
TextBox28.BackColor = Color.DarkSeaGreen
TextBox29.BackColor = Color.DarkSeaGreen
TextBox30.BackColor = Color.DarkSeaGreen
TextBox31.BackColor = Color.DarkSeaGreen
TextBox32.BackColor = Color.DarkSeaGreen
TextBox27.BackColor = Color.DarkSeaGreen
Else
TextBox28.BackColor = Color.PaleVioletRed
TextBox29.BackColor = Color.PaleVioletRed
TextBox30.BackColor = Color.PaleVioletRed
TextBox31.BackColor = Color.PaleVioletRed
TextBox32.BackColor = Color.PaleVioletRed
TextBox27.BackColor = Color.PaleVioletRed
End If
If TextBox33.Text & TextBox34.Text & TextBox35.Text & TextBox36.Text & TextBox37.Text & TextBox28.Text & TextBox38.Text & TextBox39.Text & TextBox40.Text = Word6 Then
TextBox33.BackColor = Color.DarkSeaGreen
TextBox34.BackColor = Color.DarkSeaGreen
TextBox35.BackColor = Color.DarkSeaGreen
TextBox36.BackColor = Color.DarkSeaGreen
TextBox37.BackColor = Color.DarkSeaGreen
TextBox28.BackColor = Color.DarkSeaGreen
TextBox38.BackColor = Color.DarkSeaGreen
TextBox39.BackColor = Color.DarkSeaGreen
TextBox40.BackColor = Color.DarkSeaGreen
Else
TextBox33.BackColor = Color.PaleVioletRed
TextBox34.BackColor = Color.PaleVioletRed
TextBox35.BackColor = Color.PaleVioletRed
TextBox36.BackColor = Color.PaleVioletRed
TextBox37.BackColor = Color.PaleVioletRed
TextBox28.BackColor = Color.PaleVioletRed
TextBox38.BackColor = Color.PaleVioletRed
TextBox39.BackColor = Color.PaleVioletRed
TextBox40.BackColor = Color.PaleVioletRed
End If
If TextBox22.Text & TextBox41.Text & TextBox42.Text & TextBox43.Text & TextBox44.Text & TextBox45.Text = Word7 Then
TextBox22.BackColor = Color.DarkSeaGreen
TextBox41.BackColor = Color.DarkSeaGreen
TextBox42.BackColor = Color.DarkSeaGreen
TextBox43.BackColor = Color.DarkSeaGreen
TextBox44.BackColor = Color.DarkSeaGreen
TextBox45.BackColor = Color.DarkSeaGreen
Else
TextBox22.BackColor = Color.PaleVioletRed
TextBox41.BackColor = Color.PaleVioletRed
TextBox42.BackColor = Color.PaleVioletRed
TextBox43.BackColor = Color.PaleVioletRed
TextBox44.BackColor = Color.PaleVioletRed
TextBox45.BackColor = Color.PaleVioletRed
End If
If TextBox46.Text & TextBox47.Text & TextBox48.Text & TextBox49.Text & TextBox50.Text & TextBox45.Text & TextBox51.Text & TextBox52.Text & TextBox53.Text = Word8 Then
TextBox46.BackColor = Color.DarkSeaGreen
TextBox47.BackColor = Color.DarkSeaGreen
TextBox48.BackColor = Color.DarkSeaGreen
TextBox49.BackColor = Color.DarkSeaGreen
TextBox50.BackColor = Color.DarkSeaGreen
TextBox45.BackColor = Color.DarkSeaGreen
TextBox51.BackColor = Color.DarkSeaGreen
TextBox52.BackColor = Color.DarkSeaGreen
TextBox53.BackColor = Color.DarkSeaGreen
Else
TextBox46.BackColor = Color.PaleVioletRed
TextBox47.BackColor = Color.PaleVioletRed
TextBox48.BackColor = Color.PaleVioletRed
TextBox49.BackColor = Color.PaleVioletRed
TextBox50.BackColor = Color.PaleVioletRed
TextBox45.BackColor = Color.PaleVioletRed
TextBox51.BackColor = Color.PaleVioletRed
TextBox52.BackColor = Color.PaleVioletRed
TextBox53.BackColor = Color.PaleVioletRed
End If
If TextBox26.Text & TextBox54.Text & TextBox55.Text & TextBox56.Text & TextBox57.Text = Word9 Then
TextBox26.BackColor = Color.DarkSeaGreen
TextBox54.BackColor = Color.DarkSeaGreen
TextBox55.BackColor = Color.DarkSeaGreen
TextBox56.BackColor = Color.DarkSeaGreen
TextBox57.BackColor = Color.DarkSeaGreen
Else
TextBox26.BackColor = Color.PaleVioletRed
TextBox54.BackColor = Color.PaleVioletRed
TextBox55.BackColor = Color.PaleVioletRed
TextBox56.BackColor = Color.PaleVioletRed
TextBox57.BackColor = Color.PaleVioletRed
End If
If TextBox58.Text & TextBox59.Text & TextBox31.Text & TextBox60.Text & TextBox61.Text & TextBox62.Text & TextBox63.Text & TextBox64.Text = Word10 Then
TextBox58.BackColor = Color.DarkSeaGreen
TextBox59.BackColor = Color.DarkSeaGreen
TextBox31.BackColor = Color.DarkSeaGreen
TextBox60.BackColor = Color.DarkSeaGreen
TextBox61.BackColor = Color.DarkSeaGreen
TextBox62.BackColor = Color.DarkSeaGreen
TextBox63.BackColor = Color.DarkSeaGreen
TextBox64.BackColor = Color.DarkSeaGreen
Else
TextBox58.BackColor = Color.PaleVioletRed
TextBox59.BackColor = Color.PaleVioletRed
TextBox31.BackColor = Color.PaleVioletRed
TextBox60.BackColor = Color.PaleVioletRed
TextBox61.BackColor = Color.PaleVioletRed
TextBox62.BackColor = Color.PaleVioletRed
TextBox63.BackColor = Color.PaleVioletRed
TextBox64.BackColor = Color.PaleVioletRed
End If
If TextBox65.Text & TextBox66.Text & TextBox67.Text & TextBox68.Text & TextBox69.Text & TextBox64.Text = Word11 Then
TextBox65.BackColor = Color.DarkSeaGreen
TextBox66.BackColor = Color.DarkSeaGreen
TextBox67.BackColor = Color.DarkSeaGreen
TextBox68.BackColor = Color.DarkSeaGreen
TextBox69.BackColor = Color.DarkSeaGreen
TextBox64.BackColor = Color.DarkSeaGreen
Else
TextBox65.BackColor = Color.PaleVioletRed
TextBox66.BackColor = Color.PaleVioletRed
TextBox67.BackColor = Color.PaleVioletRed
TextBox68.BackColor = Color.PaleVioletRed
TextBox69.BackColor = Color.PaleVioletRed
TextBox64.BackColor = Color.PaleVioletRed
End If
If TextBox70.Text & TextBox71.Text & TextBox35.Text & TextBox72.Text & TextBox73.Text = Word12 Then
TextBox70.BackColor = Color.DarkSeaGreen
TextBox71.BackColor = Color.DarkSeaGreen
TextBox35.BackColor = Color.DarkSeaGreen
TextBox72.BackColor = Color.DarkSeaGreen
TextBox73.BackColor = Color.DarkSeaGreen
Else
TextBox70.BackColor = Color.PaleVioletRed
TextBox71.BackColor = Color.PaleVioletRed
TextBox35.BackColor = Color.PaleVioletRed
TextBox72.BackColor = Color.PaleVioletRed
TextBox73.BackColor = Color.PaleVioletRed
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Close()
GameSelect.Visible = True
End Sub
End Class
Is there ANY possible way I can shorten this code? Its simply ridiculous. I have tried to think of a way to create an array of sorts, but I keep failing because of the conflicting textboxes overlapping, which I believe is the biggest problem in trying to
create an array for this game. If anyone can help me to construct something Id be very very grateful!
View the full article
Public Class Crossword
Dim Word1 As String
Dim Word2 As String
Dim Word3 As String
Dim Word4 As String
Dim Word5 As String
Dim Word6 As String
Dim Word7 As String
Dim Word8 As String
Dim Word9 As String
Dim Word10 As String
Dim Word11 As String
Dim Word12 As String
Private Sub NewGame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Word1 = "TANZEN"
Word2 = "RADFAHREN"
Word3 = "HELFEN"
Word4 = "EINKAUFEN"
Word5 = "MACHEN"
Word6 = "SCHWIMMEN"
Word7 = "KUCHEN"
Word8 = "FAULENZEN"
Word9 = "ESSEN"
Word10 = "SCHLAFEN"
Word11 = "TRAGEN"
Word12 = "GEHEN"
MsgBox("This is a crossword game about german verbs. The english verbs are given, and you have to write the german translation into the correct space. Ensure you write in capital letters.")
Button1.Text = "Check"
Button2.Text = "Back"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text & TextBox2.Text & TextBox3.Text & TextBox4.Text & TextBox5.Text & TextBox6.Text = Word1 Then
TextBox1.BackColor = Color.DarkSeaGreen
TextBox2.BackColor = Color.DarkSeaGreen
TextBox3.BackColor = Color.DarkSeaGreen
TextBox4.BackColor = Color.DarkSeaGreen
TextBox5.BackColor = Color.DarkSeaGreen
TextBox6.BackColor = Color.DarkSeaGreen
Else
TextBox1.BackColor = Color.PaleVioletRed
TextBox2.BackColor = Color.PaleVioletRed
TextBox3.BackColor = Color.PaleVioletRed
TextBox4.BackColor = Color.PaleVioletRed
TextBox5.BackColor = Color.PaleVioletRed
TextBox6.BackColor = Color.PaleVioletRed
End If
If TextBox7.Text & TextBox8.Text & TextBox9.Text & TextBox10.Text & TextBox2.Text & TextBox11.Text & TextBox12.Text & TextBox13.Text & TextBox14.Text = Word2 Then
TextBox7.BackColor = Color.DarkSeaGreen
TextBox8.BackColor = Color.DarkSeaGreen
TextBox9.BackColor = Color.DarkSeaGreen
TextBox10.BackColor = Color.DarkSeaGreen
TextBox2.BackColor = Color.DarkSeaGreen
TextBox11.BackColor = Color.DarkSeaGreen
TextBox12.BackColor = Color.DarkSeaGreen
TextBox13.BackColor = Color.DarkSeaGreen
TextBox14.BackColor = Color.DarkSeaGreen
Else
TextBox7.BackColor = Color.PaleVioletRed
TextBox8.BackColor = Color.PaleVioletRed
TextBox9.BackColor = Color.PaleVioletRed
TextBox10.BackColor = Color.PaleVioletRed
TextBox2.BackColor = Color.PaleVioletRed
TextBox11.BackColor = Color.PaleVioletRed
TextBox12.BackColor = Color.PaleVioletRed
TextBox13.BackColor = Color.PaleVioletRed
TextBox14.BackColor = Color.PaleVioletRed
End If
If TextBox15.Text & TextBox5.Text & TextBox16.Text & TextBox17.Text & TextBox18.Text & TextBox19.Text = Word3 Then
TextBox15.BackColor = Color.DarkSeaGreen
TextBox5.BackColor = Color.DarkSeaGreen
TextBox16.BackColor = Color.DarkSeaGreen
TextBox17.BackColor = Color.DarkSeaGreen
TextBox18.BackColor = Color.DarkSeaGreen
TextBox19.BackColor = Color.DarkSeaGreen
Else
TextBox15.BackColor = Color.PaleVioletRed
TextBox5.BackColor = Color.PaleVioletRed
TextBox16.BackColor = Color.PaleVioletRed
TextBox17.BackColor = Color.PaleVioletRed
TextBox18.BackColor = Color.PaleVioletRed
TextBox19.BackColor = Color.PaleVioletRed
End If
If TextBox18.Text & TextBox20.Text & TextBox21.Text & TextBox22.Text & TextBox23.Text & TextBox24.Text & TextBox25.Text & TextBox26.Text & TextBox27.Text = Word4 Then
TextBox18.BackColor = Color.DarkSeaGreen
TextBox20.BackColor = Color.DarkSeaGreen
TextBox21.BackColor = Color.DarkSeaGreen
TextBox22.BackColor = Color.DarkSeaGreen
TextBox23.BackColor = Color.DarkSeaGreen
TextBox24.BackColor = Color.DarkSeaGreen
TextBox25.BackColor = Color.DarkSeaGreen
TextBox26.BackColor = Color.DarkSeaGreen
TextBox27.BackColor = Color.DarkSeaGreen
Else
TextBox18.BackColor = Color.PaleVioletRed
TextBox20.BackColor = Color.PaleVioletRed
TextBox21.BackColor = Color.PaleVioletRed
TextBox22.BackColor = Color.PaleVioletRed
TextBox23.BackColor = Color.PaleVioletRed
TextBox24.BackColor = Color.PaleVioletRed
TextBox25.BackColor = Color.PaleVioletRed
TextBox26.BackColor = Color.PaleVioletRed
TextBox27.BackColor = Color.PaleVioletRed
End If
If TextBox28.Text & TextBox29.Text & TextBox30.Text & TextBox31.Text & TextBox32.Text & TextBox27.Text = Word5 Then
TextBox28.BackColor = Color.DarkSeaGreen
TextBox29.BackColor = Color.DarkSeaGreen
TextBox30.BackColor = Color.DarkSeaGreen
TextBox31.BackColor = Color.DarkSeaGreen
TextBox32.BackColor = Color.DarkSeaGreen
TextBox27.BackColor = Color.DarkSeaGreen
Else
TextBox28.BackColor = Color.PaleVioletRed
TextBox29.BackColor = Color.PaleVioletRed
TextBox30.BackColor = Color.PaleVioletRed
TextBox31.BackColor = Color.PaleVioletRed
TextBox32.BackColor = Color.PaleVioletRed
TextBox27.BackColor = Color.PaleVioletRed
End If
If TextBox33.Text & TextBox34.Text & TextBox35.Text & TextBox36.Text & TextBox37.Text & TextBox28.Text & TextBox38.Text & TextBox39.Text & TextBox40.Text = Word6 Then
TextBox33.BackColor = Color.DarkSeaGreen
TextBox34.BackColor = Color.DarkSeaGreen
TextBox35.BackColor = Color.DarkSeaGreen
TextBox36.BackColor = Color.DarkSeaGreen
TextBox37.BackColor = Color.DarkSeaGreen
TextBox28.BackColor = Color.DarkSeaGreen
TextBox38.BackColor = Color.DarkSeaGreen
TextBox39.BackColor = Color.DarkSeaGreen
TextBox40.BackColor = Color.DarkSeaGreen
Else
TextBox33.BackColor = Color.PaleVioletRed
TextBox34.BackColor = Color.PaleVioletRed
TextBox35.BackColor = Color.PaleVioletRed
TextBox36.BackColor = Color.PaleVioletRed
TextBox37.BackColor = Color.PaleVioletRed
TextBox28.BackColor = Color.PaleVioletRed
TextBox38.BackColor = Color.PaleVioletRed
TextBox39.BackColor = Color.PaleVioletRed
TextBox40.BackColor = Color.PaleVioletRed
End If
If TextBox22.Text & TextBox41.Text & TextBox42.Text & TextBox43.Text & TextBox44.Text & TextBox45.Text = Word7 Then
TextBox22.BackColor = Color.DarkSeaGreen
TextBox41.BackColor = Color.DarkSeaGreen
TextBox42.BackColor = Color.DarkSeaGreen
TextBox43.BackColor = Color.DarkSeaGreen
TextBox44.BackColor = Color.DarkSeaGreen
TextBox45.BackColor = Color.DarkSeaGreen
Else
TextBox22.BackColor = Color.PaleVioletRed
TextBox41.BackColor = Color.PaleVioletRed
TextBox42.BackColor = Color.PaleVioletRed
TextBox43.BackColor = Color.PaleVioletRed
TextBox44.BackColor = Color.PaleVioletRed
TextBox45.BackColor = Color.PaleVioletRed
End If
If TextBox46.Text & TextBox47.Text & TextBox48.Text & TextBox49.Text & TextBox50.Text & TextBox45.Text & TextBox51.Text & TextBox52.Text & TextBox53.Text = Word8 Then
TextBox46.BackColor = Color.DarkSeaGreen
TextBox47.BackColor = Color.DarkSeaGreen
TextBox48.BackColor = Color.DarkSeaGreen
TextBox49.BackColor = Color.DarkSeaGreen
TextBox50.BackColor = Color.DarkSeaGreen
TextBox45.BackColor = Color.DarkSeaGreen
TextBox51.BackColor = Color.DarkSeaGreen
TextBox52.BackColor = Color.DarkSeaGreen
TextBox53.BackColor = Color.DarkSeaGreen
Else
TextBox46.BackColor = Color.PaleVioletRed
TextBox47.BackColor = Color.PaleVioletRed
TextBox48.BackColor = Color.PaleVioletRed
TextBox49.BackColor = Color.PaleVioletRed
TextBox50.BackColor = Color.PaleVioletRed
TextBox45.BackColor = Color.PaleVioletRed
TextBox51.BackColor = Color.PaleVioletRed
TextBox52.BackColor = Color.PaleVioletRed
TextBox53.BackColor = Color.PaleVioletRed
End If
If TextBox26.Text & TextBox54.Text & TextBox55.Text & TextBox56.Text & TextBox57.Text = Word9 Then
TextBox26.BackColor = Color.DarkSeaGreen
TextBox54.BackColor = Color.DarkSeaGreen
TextBox55.BackColor = Color.DarkSeaGreen
TextBox56.BackColor = Color.DarkSeaGreen
TextBox57.BackColor = Color.DarkSeaGreen
Else
TextBox26.BackColor = Color.PaleVioletRed
TextBox54.BackColor = Color.PaleVioletRed
TextBox55.BackColor = Color.PaleVioletRed
TextBox56.BackColor = Color.PaleVioletRed
TextBox57.BackColor = Color.PaleVioletRed
End If
If TextBox58.Text & TextBox59.Text & TextBox31.Text & TextBox60.Text & TextBox61.Text & TextBox62.Text & TextBox63.Text & TextBox64.Text = Word10 Then
TextBox58.BackColor = Color.DarkSeaGreen
TextBox59.BackColor = Color.DarkSeaGreen
TextBox31.BackColor = Color.DarkSeaGreen
TextBox60.BackColor = Color.DarkSeaGreen
TextBox61.BackColor = Color.DarkSeaGreen
TextBox62.BackColor = Color.DarkSeaGreen
TextBox63.BackColor = Color.DarkSeaGreen
TextBox64.BackColor = Color.DarkSeaGreen
Else
TextBox58.BackColor = Color.PaleVioletRed
TextBox59.BackColor = Color.PaleVioletRed
TextBox31.BackColor = Color.PaleVioletRed
TextBox60.BackColor = Color.PaleVioletRed
TextBox61.BackColor = Color.PaleVioletRed
TextBox62.BackColor = Color.PaleVioletRed
TextBox63.BackColor = Color.PaleVioletRed
TextBox64.BackColor = Color.PaleVioletRed
End If
If TextBox65.Text & TextBox66.Text & TextBox67.Text & TextBox68.Text & TextBox69.Text & TextBox64.Text = Word11 Then
TextBox65.BackColor = Color.DarkSeaGreen
TextBox66.BackColor = Color.DarkSeaGreen
TextBox67.BackColor = Color.DarkSeaGreen
TextBox68.BackColor = Color.DarkSeaGreen
TextBox69.BackColor = Color.DarkSeaGreen
TextBox64.BackColor = Color.DarkSeaGreen
Else
TextBox65.BackColor = Color.PaleVioletRed
TextBox66.BackColor = Color.PaleVioletRed
TextBox67.BackColor = Color.PaleVioletRed
TextBox68.BackColor = Color.PaleVioletRed
TextBox69.BackColor = Color.PaleVioletRed
TextBox64.BackColor = Color.PaleVioletRed
End If
If TextBox70.Text & TextBox71.Text & TextBox35.Text & TextBox72.Text & TextBox73.Text = Word12 Then
TextBox70.BackColor = Color.DarkSeaGreen
TextBox71.BackColor = Color.DarkSeaGreen
TextBox35.BackColor = Color.DarkSeaGreen
TextBox72.BackColor = Color.DarkSeaGreen
TextBox73.BackColor = Color.DarkSeaGreen
Else
TextBox70.BackColor = Color.PaleVioletRed
TextBox71.BackColor = Color.PaleVioletRed
TextBox35.BackColor = Color.PaleVioletRed
TextBox72.BackColor = Color.PaleVioletRed
TextBox73.BackColor = Color.PaleVioletRed
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Close()
GameSelect.Visible = True
End Sub
End Class
Is there ANY possible way I can shorten this code? Its simply ridiculous. I have tried to think of a way to create an array of sorts, but I keep failing because of the conflicting textboxes overlapping, which I believe is the biggest problem in trying to
create an array for this game. If anyone can help me to construct something Id be very very grateful!
View the full article