Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Ship Battle - Form1.vb

Form1.vb

Caricato da: R0gerblack
Scarica il programma completo

  1. Public Class Form1
  2.     Dim BoardHuman(4, 4) As PictureBox
  3.     Dim BoardPC(4, 4) As PictureBox
  4.     Dim Barche_Restanti As Int16 = 4
  5.     Dim HumanCount As Int16
  6.     Dim PCCount As Int16
  7.     Dim turno As Boolean = True
  8.     Dim rndx As New Random
  9.     Dim rndy As New Random
  10.     Dim a, b As String
  11.     Dim c, d As Integer
  12.     Dim g, f As New Random
  13.     Dim one, two, three, four As String
  14.     Dim MDODICI As Integer
  15.     Private Sub Add_Handler()
  16.         'Aggiungi eventi a tutte le caselle BoardHuman
  17.         AddHandler BoardHuman(1, 1).Click, AddressOf BoardHuman11_Click
  18.         AddHandler BoardHuman(1, 2).Click, AddressOf BoardHuman12_Click
  19.         AddHandler BoardHuman(1, 3).Click, AddressOf BoardHuman13_Click
  20.         AddHandler BoardHuman(1, 4).Click, AddressOf BoardHuman14_Click
  21.         AddHandler BoardHuman(2, 1).Click, AddressOf BoardHuman21_Click
  22.         AddHandler BoardHuman(2, 2).Click, AddressOf BoardHuman22_Click
  23.         AddHandler BoardHuman(2, 3).Click, AddressOf BoardHuman23_Click
  24.         AddHandler BoardHuman(2, 4).Click, AddressOf BoardHuman24_Click
  25.         AddHandler BoardHuman(3, 1).Click, AddressOf BoardHuman31_Click
  26.         AddHandler BoardHuman(3, 2).Click, AddressOf BoardHuman32_Click
  27.         AddHandler BoardHuman(3, 3).Click, AddressOf BoardHuman33_Click
  28.         AddHandler BoardHuman(3, 4).Click, AddressOf BoardHuman34_Click
  29.         AddHandler BoardHuman(4, 1).Click, AddressOf BoardHuman41_Click
  30.         AddHandler BoardHuman(4, 2).Click, AddressOf BoardHuman42_Click
  31.         AddHandler BoardHuman(4, 3).Click, AddressOf BoardHuman43_Click
  32.         AddHandler BoardHuman(4, 4).Click, AddressOf BoardHuman44_Click
  33.         AddHandler BoardPC(1, 1).Click, AddressOf BoardPC11_Click
  34.         AddHandler BoardPC(1, 2).Click, AddressOf BoardPC12_Click
  35.         AddHandler BoardPC(1, 3).Click, AddressOf BoardPC13_Click
  36.         AddHandler BoardPC(1, 4).Click, AddressOf BoardPC14_Click
  37.         AddHandler BoardPC(2, 1).Click, AddressOf BoardPC21_Click
  38.         AddHandler BoardPC(2, 2).Click, AddressOf BoardPC22_Click
  39.         AddHandler BoardPC(2, 3).Click, AddressOf BoardPC23_Click
  40.         AddHandler BoardPC(2, 4).Click, AddressOf BoardPC24_Click
  41.         AddHandler BoardPC(3, 1).Click, AddressOf BoardPC31_Click
  42.         AddHandler BoardPC(3, 2).Click, AddressOf BoardPC32_Click
  43.         AddHandler BoardPC(3, 3).Click, AddressOf BoardPC33_Click
  44.         AddHandler BoardPC(3, 4).Click, AddressOf BoardPC34_Click
  45.         AddHandler BoardPC(4, 1).Click, AddressOf BoardPC41_Click
  46.         AddHandler BoardPC(4, 2).Click, AddressOf BoardPC42_Click
  47.         AddHandler BoardPC(4, 3).Click, AddressOf BoardPC43_Click
  48.         AddHandler BoardPC(4, 4).Click, AddressOf BoardPC44_Click
  49.     End Sub
  50.  
  51.     Private Sub Resetta_variabili()
  52.         Barche_Restanti = 4
  53.         PCCount = 0
  54.         HumanCount = 0
  55.         Label5.Text = "Barche restanti: 4"
  56.         Label6.Text = "Posiziona la tua flotta"
  57.         MDODICI = 0
  58.         For i = 1 To 4
  59.             For j = 1 To 4
  60.                 BoardHuman(i, j).BackColor = Color.White
  61.                 BoardPC(i, j).BackColor = Color.White
  62.             Next
  63.         Next
  64.         turno = True
  65.         Calcola_4_posizioni()
  66.     End Sub
  67.  
  68.     Private Sub Calcola_4_posizioni()
  69.         'Prima posizione scelta dal PC
  70.         c = g.Next(1, 5)
  71.         f.Next(1, 5)
  72.         d = f.Next(1, 5)
  73.         one = c & " " & d
  74.         'Seconda posizione scelta dal PC
  75.         c = g.Next(1, 5)
  76.         f.Next(1, 5)
  77.         d = f.Next(1, 5)
  78.         two = c & " " & d
  79.         'Terza posizione scelta dal PC
  80.         c = g.Next(1, 5)
  81.         f.Next(1, 5)
  82.         d = f.Next(1, 5)
  83.         three = c & " " & d
  84.         'Quarta posizione scelta dal PC
  85.         c = g.Next(1, 5)
  86.         f.Next(1, 5)
  87.         d = f.Next(1, 5)
  88.         four = c & " " & d
  89.         If one = two Or one = three Or one = four _
  90.             Or two = one Or two = three Or two = four _
  91.             Or three = one Or three = two Or three = four _
  92.             Or four = one Or four = two Or four = three Then
  93.             Calcola_4_posizioni()
  94.         End If
  95.         turno = True
  96.     End Sub
  97.  
  98.     Private Sub posizione_A_caso()
  99.         If Label3.Visible = True Then
  100.             Exit Sub
  101.         End If
  102.         If PCCount = 4 Then
  103.             Exit Sub
  104.         End If
  105.         'Se è il turno del computer
  106.         If turno = False Then
  107.             'Se hai posizionato tutte le barche
  108.             If MDODICI >= 12 Then
  109.                 MsgBox("Hai sprecato tutti i tentativi, hai perso!", MsgBoxStyle.Exclamation)
  110.                 Resetta_variabili()
  111.                 Exit Sub
  112.             End If
  113.             If Not Label6.Text = "Buon gioco" Then
  114.                 MsgBox("Posizionare prima le navi", MsgBoxStyle.Critical)
  115.                 Exit Sub
  116.             End If
  117.  
  118.             'Posizione a caso
  119.             a = rndy.Next(1, 5)
  120.             rndx.Next(1, 5)
  121.             b = rndx.Next(1, 5)
  122.             'Se va sul colore bianco o sul colore verde
  123.             If BoardHuman(a, b).BackColor = Color.White Then
  124.                 If RadioButton1.Checked = True Then
  125.                     BoardHuman(a, b).BackColor = Color.Red
  126.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  127.                     turno = True
  128.                 ElseIf RadioButton2.Checked = True Then
  129.                     If MDODICI >= 12 Then
  130.                         MsgBox("Hai sprecato tutti i tentativi, hai perso!", MsgBoxStyle.Critical)
  131.                         Resetta_variabili()
  132.                     End If
  133.                     MDODICI += 1
  134.                     BoardHuman(a, b).BackColor = Color.Red
  135.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  136.                     turno = True
  137.                 End If
  138.             ElseIf BoardHuman(a, b).BackColor = Color.Lime Then
  139.                 If RadioButton1.Checked = True Then
  140.                     My.Computer.Audio.Play(My.Resources.Boink2, AudioPlayMode.Background)
  141.                     BoardHuman(a, b).BackColor = Color.Red
  142.                     'Conta come nave distrutta
  143.                     PCCount += 1
  144.                     'Se ha abbattuto tutte e 4 le navi
  145.                     If PCCount >= 4 Then
  146.                         MsgBox("Hai perso", MsgBoxStyle.Exclamation)
  147.                         'Resetta le variabili
  148.                         Resetta_variabili()
  149.                         Return
  150.                     End If
  151.                 ElseIf RadioButton2.Checked = True Then
  152.                     If BoardHuman(a, b).BackColor = Color.Lime Then
  153.                         posizione_A_caso()
  154.                     End If
  155.                 End If
  156.  
  157.                 'Se ha colpito una sua casella, tenta di nuovo
  158.             ElseIf BoardHuman(a, b).BackColor = Color.Red Then
  159.                 posizione_A_caso()
  160.                 Exit Sub
  161.             End If
  162.             turno = True
  163.         End If
  164.     End Sub
  165.  
  166.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  167.         Label1.Visible = False
  168.         Label2.Visible = False
  169.  
  170.     End Sub
  171.  
  172. #Region "Colora BoardHuman"
  173.     Private Sub BoardHuman31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  174.         If Barche_Restanti > 0 Then
  175.             If BoardHuman(3, 1).BackColor = Color.Lime Then
  176.                 Exit Sub
  177.             End If
  178.             BoardHuman(3, 1).BackColor = Color.Lime
  179.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  180.             Barche_Restanti -= 1
  181.             Label5.Text = "Barche restanti: " & Barche_Restanti
  182.             If Barche_Restanti = 0 Then
  183.                 Label6.Text = "Buon gioco"
  184.             End If
  185.         End If
  186.     End Sub
  187.     Private Sub BoardHuman32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  188.         If BoardHuman(3, 2).BackColor = Color.Lime Then
  189.             Exit Sub
  190.         End If
  191.         If Barche_Restanti > 0 Then
  192.             BoardHuman(3, 2).BackColor = Color.Lime
  193.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  194.             Barche_Restanti -= 1
  195.             Label5.Text = "Barche restanti: " & Barche_Restanti
  196.             If Barche_Restanti = 0 Then
  197.                 Label6.Text = "Buon gioco"
  198.             End If
  199.         End If
  200.     End Sub
  201.     Private Sub BoardHuman33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  202.         If Barche_Restanti > 0 Then
  203.             If BoardHuman(3, 3).BackColor = Color.Lime Then
  204.                 Exit Sub
  205.             End If
  206.             BoardHuman(3, 3).BackColor = Color.Lime
  207.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  208.             Barche_Restanti -= 1
  209.             Label5.Text = "Barche restanti: " & Barche_Restanti
  210.             If Barche_Restanti = 0 Then
  211.                 Label6.Text = "Buon gioco"
  212.             End If
  213.         End If
  214.     End Sub
  215.     Private Sub BoardHuman34_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  216.         If Barche_Restanti > 0 Then
  217.             If BoardHuman(3, 4).BackColor = Color.Lime Then
  218.                 Exit Sub
  219.             End If
  220.             BoardHuman(3, 4).BackColor = Color.Lime
  221.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  222.             Barche_Restanti -= 1
  223.             Label5.Text = "Barche restanti: " & Barche_Restanti
  224.             If Barche_Restanti = 0 Then
  225.                 Label6.Text = "Buon gioco"
  226.             End If
  227.         End If
  228.     End Sub
  229.     Private Sub BoardHuman41_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  230.  
  231.         If Barche_Restanti > 0 Then
  232.             If BoardHuman(4, 1).BackColor = Color.Lime Then
  233.                 Exit Sub
  234.             End If
  235.             BoardHuman(4, 1).BackColor = Color.Lime
  236.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  237.             Barche_Restanti -= 1
  238.             Label5.Text = "Barche restanti: " & Barche_Restanti
  239.             If Barche_Restanti = 0 Then
  240.                 Label6.Text = "Buon gioco"
  241.             End If
  242.         End If
  243.     End Sub
  244.     Private Sub BoardHuman42_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  245.         If Barche_Restanti > 0 Then
  246.             If BoardHuman(4, 2).BackColor = Color.Lime Then
  247.                 Exit Sub
  248.             End If
  249.             BoardHuman(4, 2).BackColor = Color.Lime
  250.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  251.             Barche_Restanti -= 1
  252.             Label5.Text = "Barche restanti: " & Barche_Restanti
  253.             If Barche_Restanti = 0 Then
  254.                 Label6.Text = "Buon gioco"
  255.             End If
  256.         End If
  257.     End Sub
  258.     Private Sub BoardHuman43_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  259.         If Barche_Restanti > 0 Then
  260.             If BoardHuman(4, 3).BackColor = Color.Lime Then
  261.                 Exit Sub
  262.             End If
  263.             BoardHuman(4, 3).BackColor = Color.Lime
  264.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  265.             Barche_Restanti -= 1
  266.             Label5.Text = "Barche restanti: " & Barche_Restanti
  267.             If Barche_Restanti = 0 Then
  268.                 Label6.Text = "Buon gioco"
  269.             End If
  270.         End If
  271.     End Sub
  272.     Private Sub BoardHuman44_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  273.         If Barche_Restanti > 0 Then
  274.             If BoardHuman(4, 4).BackColor = Color.Lime Then
  275.                 Exit Sub
  276.             End If
  277.             BoardHuman(4, 4).BackColor = Color.Lime
  278.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  279.             Barche_Restanti -= 1
  280.             Label5.Text = "Barche restanti: " & Barche_Restanti
  281.             If Barche_Restanti = 0 Then
  282.                 Label6.Text = "Buon gioco"
  283.             End If
  284.         End If
  285.     End Sub
  286.     Private Sub BoardHuman11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  287.         If Barche_Restanti > 0 Then
  288.             If BoardHuman(1, 1).BackColor = Color.Lime Then
  289.                 Exit Sub
  290.             End If
  291.             BoardHuman(1, 1).BackColor = Color.Lime
  292.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  293.             Barche_Restanti -= 1
  294.             Label5.Text = "Barche restanti: " & Barche_Restanti
  295.             If Barche_Restanti = 0 Then
  296.                 Label6.Text = "Buon gioco"
  297.             End If
  298.         End If
  299.     End Sub
  300.     Private Sub BoardHuman12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  301.         If Barche_Restanti > 0 Then
  302.             If BoardHuman(1, 2).BackColor = Color.Lime Then
  303.                 Exit Sub
  304.             End If
  305.             BoardHuman(1, 2).BackColor = Color.Lime
  306.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  307.             Barche_Restanti -= 1
  308.             Label5.Text = "Barche restanti: " & Barche_Restanti
  309.             If Barche_Restanti = 0 Then
  310.                 Label6.Text = "Buon gioco"
  311.             End If
  312.         End If
  313.     End Sub
  314.     Private Sub BoardHuman13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  315.         If Barche_Restanti > 0 Then
  316.             If BoardHuman(1, 3).BackColor = Color.Lime Then
  317.                 Exit Sub
  318.             End If
  319.             BoardHuman(1, 3).BackColor = Color.Lime
  320.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  321.             Barche_Restanti -= 1
  322.             Label5.Text = "Barche restanti: " & Barche_Restanti
  323.             If Barche_Restanti = 0 Then
  324.                 Label6.Text = "Buon gioco"
  325.             End If
  326.         End If
  327.     End Sub
  328.     Private Sub BoardHuman14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  329.         If Barche_Restanti > 0 Then
  330.             If BoardHuman(1, 4).BackColor = Color.Lime Then
  331.                 Exit Sub
  332.             End If
  333.             BoardHuman(1, 4).BackColor = Color.Lime
  334.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  335.             Barche_Restanti -= 1
  336.             Label5.Text = "Barche restanti: " & Barche_Restanti
  337.             If Barche_Restanti = 0 Then
  338.                 Label6.Text = "Buon gioco"
  339.             End If
  340.         End If
  341.     End Sub
  342.     Private Sub BoardHuman21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  343.         If Barche_Restanti > 0 Then
  344.             If BoardHuman(2, 1).BackColor = Color.Lime Then
  345.                 Exit Sub
  346.             End If
  347.             BoardHuman(2, 1).BackColor = Color.Lime
  348.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  349.             Barche_Restanti -= 1
  350.             Label5.Text = "Barche restanti: " & Barche_Restanti
  351.             If Barche_Restanti = 0 Then
  352.                 Label6.Text = "Buon gioco"
  353.             End If
  354.         End If
  355.     End Sub
  356.     Private Sub BoardHuman22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  357.         If Barche_Restanti > 0 Then
  358.             If BoardHuman(2, 2).BackColor = Color.Lime Then
  359.                 Exit Sub
  360.             End If
  361.             BoardHuman(2, 2).BackColor = Color.Lime
  362.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  363.             Barche_Restanti -= 1
  364.             Label5.Text = "Barche restanti: " & Barche_Restanti
  365.             If Barche_Restanti = 0 Then
  366.                 Label6.Text = "Buon gioco"
  367.             End If
  368.         End If
  369.     End Sub
  370.     Private Sub BoardHuman23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  371.         If Barche_Restanti > 0 Then
  372.             If BoardHuman(2, 3).BackColor = Color.Lime Then
  373.                 Exit Sub
  374.             End If
  375.             BoardHuman(2, 3).BackColor = Color.Lime
  376.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  377.             Barche_Restanti -= 1
  378.             Label5.Text = "Barche restanti: " & Barche_Restanti
  379.             If Barche_Restanti = 0 Then
  380.                 Label6.Text = "Buon gioco"
  381.             End If
  382.         End If
  383.     End Sub
  384.     Private Sub BoardHuman24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  385.         If Barche_Restanti > 0 Then
  386.             If BoardHuman(2, 4).BackColor = Color.Lime Then
  387.                 Exit Sub
  388.             End If
  389.             BoardHuman(2, 4).BackColor = Color.Lime
  390.             My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  391.             Barche_Restanti -= 1
  392.             Label5.Text = "Barche restanti: " & Barche_Restanti
  393.             If Barche_Restanti = 0 Then
  394.                 Label6.Text = "Buon gioco"
  395.             End If
  396.         End If
  397.     End Sub
  398. #End Region
  399.  
  400. #Region "Colora BoardPC"
  401.     Private Sub BoardPC31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  402.         If Barche_Restanti = 0 Then
  403.             If BoardPC(3, 1).BackColor = Color.Yellow Or BoardPC(3, 1).BackColor = Color.Lime Then
  404.                 Exit Sub
  405.             End If
  406.             If turno = True Then
  407.                 BoardPC(3, 1).BackColor = Color.Yellow
  408.                 If one = "3 1" Or two = "3 1" Or three = "3 1" Or four = "3 1" Then
  409.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  410.                     BoardPC(3, 1).BackColor = Color.Lime
  411.  
  412.                     HumanCount += 1
  413.                     If HumanCount = 4 Then
  414.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  415.                         Resetta_variabili()
  416.                         Exit Sub
  417.                     End If
  418.                 Else
  419.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  420.                 End If
  421.             End If
  422.             turno = False
  423.             posizione_A_caso()
  424.         End If
  425.     End Sub
  426.     Private Sub BoardPC32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  427.         If Barche_Restanti = 0 Then
  428.             If BoardPC(3, 2).BackColor = Color.Yellow Or BoardPC(3, 2).BackColor = Color.Lime Then
  429.                 Exit Sub
  430.             End If
  431.             If turno = True Then
  432.                 BoardPC(3, 2).BackColor = Color.Yellow
  433.                 If one = "3 2" Or two = "3 2" Or three = "3 2" Or four = "3 2" Then
  434.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  435.                     BoardPC(3, 2).BackColor = Color.Lime
  436.  
  437.                     HumanCount += 1
  438.                     If HumanCount = 4 Then
  439.                         Resetta_variabili()
  440.                         Exit Sub
  441.                     End If
  442.                 Else
  443.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  444.                 End If
  445.             End If
  446.             turno = False
  447.             posizione_A_caso()
  448.         End If
  449.     End Sub
  450.     Private Sub BoardPC33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  451.         If BoardPC(3, 3).BackColor = Color.Yellow Or BoardPC(3, 3).BackColor = Color.Lime Then
  452.             Exit Sub
  453.         End If
  454.         If Barche_Restanti = 0 Then
  455.             If turno = True Then
  456.                 BoardPC(3, 3).BackColor = Color.Yellow
  457.                 If one = "3 3" Or two = "3 3" Or three = "3 3" Or four = "3 3" Then
  458.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  459.                     BoardPC(3, 3).BackColor = Color.Lime
  460.  
  461.                     HumanCount += 1
  462.                     If HumanCount = 4 Then
  463.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  464.                         Resetta_variabili()
  465.                         Exit Sub
  466.                     End If
  467.                 Else
  468.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  469.                 End If
  470.             End If
  471.             turno = False
  472.             posizione_A_caso()
  473.         End If
  474.     End Sub
  475.     Private Sub BoardPC34_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  476.         If BoardPC(3, 4).BackColor = Color.Yellow Or BoardPC(3, 4).BackColor = Color.Lime Then
  477.             Exit Sub
  478.         End If
  479.         If Barche_Restanti = 0 Then
  480.             If turno = True Then
  481.                 BoardPC(3, 4).BackColor = Color.Yellow
  482.                 If one = "3 4" Or two = "3 4" Or three = "3 4" Or four = "3 4" Then
  483.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  484.                     BoardPC(3, 4).BackColor = Color.Lime
  485.  
  486.                     HumanCount += 1
  487.                     If HumanCount = 4 Then
  488.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  489.                         Resetta_variabili()
  490.                         Exit Sub
  491.                     End If
  492.                 Else
  493.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  494.                 End If
  495.             End If
  496.             turno = False
  497.             posizione_A_caso()
  498.         End If
  499.     End Sub
  500.     Private Sub BoardPC41_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  501.         If BoardPC(4, 1).BackColor = Color.Yellow Or BoardPC(4, 1).BackColor = Color.Lime Then
  502.             Exit Sub
  503.         End If
  504.         If Barche_Restanti = 0 Then
  505.             If turno = True Then
  506.                 BoardPC(4, 1).BackColor = Color.Yellow
  507.                 If one = "4 1" Or two = "4 1" Or three = "4 1" Or four = "4 1" Then
  508.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  509.                     BoardPC(4, 1).BackColor = Color.Lime
  510.  
  511.                     HumanCount += 1
  512.                     If HumanCount = 4 Then
  513.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  514.                         Resetta_variabili()
  515.                         Exit Sub
  516.                     End If
  517.                 Else
  518.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  519.                 End If
  520.             End If
  521.             turno = False
  522.             posizione_A_caso()
  523.         End If
  524.     End Sub
  525.     Private Sub BoardPC42_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  526.         If BoardPC(4, 2).BackColor = Color.Yellow Or BoardPC(4, 2).BackColor = Color.Lime Then
  527.             Exit Sub
  528.         End If
  529.         If Barche_Restanti = 0 Then
  530.             If turno = True Then
  531.                 BoardPC(4, 2).BackColor = Color.Yellow
  532.                 If one = "4 2" Or two = "4 2" Or three = "4 2" Or four = "4 2" Then
  533.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  534.                     BoardPC(4, 2).BackColor = Color.Lime
  535.  
  536.                     HumanCount += 1
  537.                     If HumanCount = 4 Then
  538.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  539.                         Resetta_variabili()
  540.                         Exit Sub
  541.                     End If
  542.                 Else
  543.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  544.                 End If
  545.             End If
  546.             turno = False
  547.             posizione_A_caso()
  548.         End If
  549.     End Sub
  550.     Private Sub BoardPC43_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  551.         If BoardPC(4, 3).BackColor = Color.Yellow Or BoardPC(4, 3).BackColor = Color.Lime Then
  552.             Exit Sub
  553.         End If
  554.         If Barche_Restanti = 0 Then
  555.             If turno = True Then
  556.                 If BoardPC(4, 3).BackColor = Color.Yellow Or BoardPC(4, 3).BackColor = Color.Lime Then
  557.                     Exit Sub
  558.                 End If
  559.                 BoardPC(4, 3).BackColor = Color.Yellow
  560.                 If one = "4 3" Or two = "4 3" Or three = "4 3" Or four = "4 3" Then
  561.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  562.                     BoardPC(4, 3).BackColor = Color.Lime
  563.  
  564.                     HumanCount += 1
  565.                     If HumanCount = 4 Then
  566.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  567.                         Resetta_variabili()
  568.                         Exit Sub
  569.                     End If
  570.                 Else
  571.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  572.                 End If
  573.             End If
  574.             turno = False
  575.             posizione_A_caso()
  576.         End If
  577.     End Sub
  578.     Private Sub BoardPC44_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  579.         If BoardPC(4, 4).BackColor = Color.Yellow Or BoardPC(4, 4).BackColor = Color.Lime Then
  580.             Exit Sub
  581.         End If
  582.         If Barche_Restanti = 0 Then
  583.             If turno = True Then
  584.                 BoardPC(4, 4).BackColor = Color.Yellow
  585.                 If one = "4 4" Or two = "4 4" Or three = "4 4" Or four = "4 4" Then
  586.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  587.                     BoardPC(4, 4).BackColor = Color.Lime
  588.  
  589.                     HumanCount += 1
  590.                     If HumanCount = 4 Then
  591.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  592.                         Resetta_variabili()
  593.                         Exit Sub
  594.                     End If
  595.                 Else
  596.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  597.                 End If
  598.             End If
  599.             turno = False
  600.             posizione_A_caso()
  601.         End If
  602.     End Sub
  603.     Private Sub BoardPC11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  604.         If BoardPC(1, 1).BackColor = Color.Yellow Or BoardPC(1, 1).BackColor = Color.Lime Then
  605.             Exit Sub
  606.         End If
  607.         If Barche_Restanti = 0 Then
  608.             If turno = True Then
  609.                 BoardPC(1, 1).BackColor = Color.Yellow
  610.                 If one = "1 1" Or two = "1 1" Or three = "1 1" Or four = "1 1" Then
  611.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  612.                     BoardPC(1, 1).BackColor = Color.Lime
  613.  
  614.                     HumanCount += 1
  615.                     If HumanCount = 4 Then
  616.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  617.                         Resetta_variabili()
  618.                         Exit Sub
  619.                     End If
  620.                 Else
  621.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  622.                 End If
  623.             End If
  624.             turno = False
  625.             posizione_A_caso()
  626.         End If
  627.     End Sub
  628.     Private Sub BoardPC12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  629.         If BoardPC(1, 2).BackColor = Color.Yellow Or BoardPC(1, 2).BackColor = Color.Lime Then
  630.             Exit Sub
  631.         End If
  632.         If Barche_Restanti = 0 Then
  633.             If turno = True Then
  634.                 BoardPC(1, 2).BackColor = Color.Yellow
  635.                 If one = "1 2" Or two = "1 2" Or three = "1 2" Or four = "1 2" Then
  636.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  637.                     BoardPC(1, 2).BackColor = Color.Lime
  638.  
  639.                     HumanCount += 1
  640.                     If HumanCount = 4 Then
  641.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  642.                         Resetta_variabili()
  643.                         Exit Sub
  644.                     End If
  645.                 Else
  646.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  647.                 End If
  648.             End If
  649.             turno = False
  650.             posizione_A_caso()
  651.         End If
  652.     End Sub
  653.     Private Sub BoardPC13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  654.         If BoardPC(1, 3).BackColor = Color.Yellow Or BoardPC(1, 3).BackColor = Color.Lime Then
  655.             Exit Sub
  656.         End If
  657.         If Barche_Restanti = 0 Then
  658.             If turno = True Then
  659.                 BoardPC(1, 3).BackColor = Color.Yellow
  660.                 If one = "1 3" Or two = "1 3" Or three = "1 3" Or four = "1 3" Then
  661.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  662.                     BoardPC(1, 3).BackColor = Color.Lime
  663.  
  664.                     HumanCount += 1
  665.                     If HumanCount = 4 Then
  666.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  667.                         Resetta_variabili()
  668.                         Exit Sub
  669.                     End If
  670.                 Else
  671.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  672.                 End If
  673.             End If
  674.             turno = False
  675.             posizione_A_caso()
  676.         End If
  677.     End Sub
  678.     Private Sub BoardPC14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  679.         If BoardPC(1, 4).BackColor = Color.Yellow Or BoardPC(1, 4).BackColor = Color.Lime Then
  680.             Exit Sub
  681.         End If
  682.         If Barche_Restanti = 0 Then
  683.             If turno = True Then
  684.                 BoardPC(1, 4).BackColor = Color.Yellow
  685.                 If one = "1 4" Or two = "1 4" Or three = "1 4" Or four = "1 4" Then
  686.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  687.                     BoardPC(1, 4).BackColor = Color.Lime
  688.                     HumanCount += 1
  689.                     If HumanCount = 4 Then
  690.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  691.                         Resetta_variabili()
  692.                         Exit Sub
  693.                     End If
  694.                 Else
  695.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  696.                 End If
  697.             End If
  698.             turno = False
  699.             posizione_A_caso()
  700.         End If
  701.     End Sub
  702.     Private Sub BoardPC21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  703.         If Barche_Restanti = 0 Then
  704.             If BoardPC(2, 1).BackColor = Color.Yellow Or BoardPC(2, 1).BackColor = Color.Lime Then
  705.                 Exit Sub
  706.             End If
  707.             If turno = True Then
  708.                 BoardPC(2, 1).BackColor = Color.Yellow
  709.                 If one = "2 1" Or two = "2 1" Or three = "2 1" Or four = "2 1" Then
  710.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  711.                     BoardPC(2, 1).BackColor = Color.Lime
  712.  
  713.                     HumanCount += 1
  714.                     If HumanCount = 4 Then
  715.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  716.                         Resetta_variabili()
  717.                         Exit Sub
  718.                     End If
  719.                 Else
  720.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  721.                 End If
  722.             End If
  723.             turno = False
  724.             posizione_A_caso()
  725.         End If
  726.     End Sub
  727.     Private Sub BoardPC22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  728.         If BoardPC(2, 2).BackColor = Color.Yellow Or BoardPC(2, 2).BackColor = Color.Lime Then
  729.             Exit Sub
  730.         End If
  731.         If Barche_Restanti = 0 Then
  732.             If turno = True Then
  733.                 BoardPC(2, 2).BackColor = Color.Yellow
  734.                 If one = "2 2" Or two = "2 2" Or three = "2 2" Or four = "2 2" Then
  735.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  736.                     BoardPC(2, 2).BackColor = Color.Lime
  737.                     HumanCount += 1
  738.                     If HumanCount = 4 Then
  739.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  740.                         Resetta_variabili()
  741.                         Exit Sub
  742.                     End If
  743.                 Else
  744.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  745.                 End If
  746.             End If
  747.             turno = False
  748.             posizione_A_caso()
  749.         End If
  750.     End Sub
  751.     Private Sub BoardPC23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  752.         If BoardPC(2, 3).BackColor = Color.Yellow Or BoardPC(2, 3).BackColor = Color.Lime Then
  753.             Exit Sub
  754.         End If
  755.         If Barche_Restanti = 0 Then
  756.             If turno = True Then
  757.                 BoardPC(2, 3).BackColor = Color.Yellow
  758.                 If one = "2 3" Or two = "2 3" Or three = "2 3" Or four = "2 3" Then
  759.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  760.                     BoardPC(2, 3).BackColor = Color.Lime
  761.                     HumanCount += 1
  762.                     If HumanCount = 4 Then
  763.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  764.                         Resetta_variabili()
  765.                         Exit Sub
  766.                     End If
  767.                 Else
  768.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  769.                 End If
  770.  
  771.             End If
  772.             turno = False
  773.             posizione_A_caso()
  774.         End If
  775.     End Sub
  776.     Private Sub BoardPC24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  777.         If BoardPC(2, 4).BackColor = Color.Yellow Or BoardPC(2, 4).BackColor = Color.Lime Then
  778.             Exit Sub
  779.         End If
  780.         If Barche_Restanti = 0 Then
  781.             If turno = True Then
  782.                 BoardPC(2, 4).BackColor = Color.Yellow
  783.                 If one = "2 4" Or two = "2 4" Or three = "2 4" Or four = "2 4" Then
  784.                     My.Computer.Audio.Play(My.Resources.Beep, AudioPlayMode.Background)
  785.                     BoardPC(2, 4).BackColor = Color.Lime
  786.                     HumanCount += 1
  787.                     If HumanCount = 4 Then
  788.                         MsgBox("Hai vinto!", MsgBoxStyle.Exclamation)
  789.                         Resetta_variabili()
  790.                         Exit Sub
  791.                     End If
  792.                 Else
  793.                     My.Computer.Audio.Play(My.Resources.Boink1, AudioPlayMode.Background)
  794.                 End If
  795.             End If
  796.             turno = False
  797.             posizione_A_caso()
  798.         End If
  799.     End Sub
  800. #End Region
  801.  
  802.  
  803.     Private Sub BoardPC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  804.         If Not Label6.Text = "Buon gioco" Then
  805.             MsgBox("Posizionare prima le navi", MsgBoxStyle.Critical)
  806.             Exit Sub
  807.         End If
  808.  
  809.     End Sub
  810.  
  811.     Private Sub Starta()
  812.  
  813.         Label1.Visible = True
  814.         Label2.Visible = True
  815.         Label3.Visible = False
  816.         Label4.Visible = False
  817.         Label5.Visible = True
  818.         Label6.Visible = True
  819.         For i = 1 To 4
  820.             For j = 1 To 4
  821.  
  822.                 BoardHuman(i, j) = New PictureBox
  823.                 BoardHuman(i, j).Size = New Size(22, 22)
  824.                 BoardHuman(i, j).BorderStyle = BorderStyle.FixedSingle
  825.                 BoardHuman(i, j).Location = New Point(i * 21, j * 21 + 10)
  826.                 BoardHuman(i, j).BackColor = Color.White
  827.                 Me.Controls.Add(BoardHuman(i, j))
  828.             Next
  829.         Next
  830.  
  831.         For i = 1 To 4
  832.             For j = 1 To 4
  833.                 BoardPC(i, j) = New PictureBox
  834.                 BoardPC(i, j).Size = New Size(22, 22)
  835.                 BoardPC(i, j).BorderStyle = BorderStyle.FixedSingle
  836.                 BoardPC(i, j).Location = New Point(i * 21, j * 21 + 130)
  837.                 BoardPC(i, j).BackColor = Color.White
  838.                 Me.Controls.Add(BoardPC(i, j))
  839.                 AddHandler BoardPC(i, j).Click, AddressOf BoardPC_Click
  840.             Next
  841.         Next
  842.         Add_Handler()
  843.         Calcola_4_posizioni()
  844.     End Sub
  845.  
  846.     Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
  847.         Starta()
  848.     End Sub
  849.  
  850.     Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
  851.         Me.Close()
  852.     End Sub
  853.  
  854.     Private Sub Label3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label3.MouseDown
  855.         Label3.ForeColor = Color.DarkRed
  856.     End Sub
  857.  
  858.     Private Sub Label3_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label3.MouseEnter
  859.         Label3.ForeColor = Color.Red
  860.     End Sub
  861.  
  862.     Private Sub Label3_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label3.MouseLeave
  863.         Label3.ForeColor = Color.Black
  864.     End Sub
  865.  
  866.     Private Sub Label4_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label4.MouseDown
  867.         Label4.ForeColor = Color.DarkRed
  868.     End Sub
  869.  
  870.     Private Sub Label4_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label4.MouseEnter
  871.         Label4.ForeColor = Color.Red
  872.     End Sub
  873.  
  874.     Private Sub Label4_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label4.MouseLeave
  875.         Label4.ForeColor = Color.Black
  876.     End Sub
  877.  
  878.     Private Sub Label7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label7.Click
  879.         AboutBox1.ShowDialog()
  880.     End Sub
  881.  
  882.     Private Sub Label7_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label7.MouseDown
  883.         Label7.BackColor = Color.Goldenrod
  884.     End Sub
  885.  
  886.     Private Sub Label7_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label7.MouseEnter
  887.         Label7.BackColor = Color.Gold
  888.     End Sub
  889.  
  890.     Private Sub Label7_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label7.MouseLeave
  891.         Label7.BackColor = Color.Transparent
  892.     End Sub
  893.  
  894.     Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
  895.         For I = 1 To 4
  896.             For J = 1 To 4
  897.                 Controls.Remove(BoardHuman(I, J))
  898.                 Controls.Remove(BoardPC(I, J))
  899.             Next
  900.         Next
  901.         Resetta_variabili()
  902.         Starta()
  903.     End Sub
  904.  
  905.     Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
  906.         Close()
  907.     End Sub
  908.  
  909.     Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
  910.         MenuItem7.Checked = True
  911.         MenuItem8.Checked = False
  912.     End Sub
  913.  
  914.     Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
  915.         If RadioButton2.Checked = True Then
  916.             RadioButton1.Checked = True
  917.             MenuItem7.Checked = True
  918.             MenuItem8.Checked = True
  919.         Else
  920.             RadioButton2.Checked = True
  921.             MenuItem7.Checked = False
  922.             MenuItem8.Checked = True
  923.         End If
  924.     End Sub
  925.  
  926.     Private Sub MenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem8.Click
  927.         If RadioButton2.Checked = True Then
  928.             RadioButton1.Checked = True
  929.             MenuItem7.Checked = True
  930.             MenuItem8.Checked = True
  931.         Else
  932.             RadioButton2.Checked = True
  933.             MenuItem7.Checked = False
  934.             MenuItem8.Checked = True
  935.         End If
  936.     End Sub
  937.  
  938.     Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
  939.         MenuItem7.Checked = False
  940.         MenuItem8.Checked = True
  941.     End Sub
  942.  
  943.     Private Sub MenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem9.Click
  944.         AboutBox1.ShowDialog()
  945.     End Sub
  946.  
  947.     Private Sub MenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem10.Click
  948.         Try
  949.             Process.Start("Ship Battle Tutorial.rtf")
  950.         Catch ex As Exception
  951.             MsgBox("Il file Ship Battle Tutorial.rtf non è stato trovato, può essere stato spostato o rinominato", MsgBoxStyle.Critical)
  952.         End Try
  953.     End Sub
  954.  
  955.     Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click
  956.         If MenuItem12.Checked = False Then
  957.             MenuItem12.Checked = True
  958.             Label10.Visible = True
  959.             TextBox1.Visible = True
  960.         Else
  961.             MenuItem12.Checked = False
  962.             Label10.Visible = False
  963.             TextBox1.Visible = False
  964.         End If
  965.     End Sub
  966.  
  967.     Private Sub Verifica_Trucco_Seeall()
  968.         If one = "1 1" Or two = "1 1" Or three = "1 1" Or four = "1 1" Then
  969.             If Not BoardPC(1, 1).BackColor = Color.Lime Then BoardPC(1, 1).BackColor = Color.Blue
  970.         End If
  971.         If one = "1 2" Or two = "1 2" Or three = "1 2" Or four = "1 2" Then
  972.             If Not BoardPC(1, 2).BackColor = Color.Lime Then BoardPC(1, 2).BackColor = Color.Blue
  973.         End If
  974.         If one = "1 3" Or two = "1 3" Or three = "1 3" Or four = "1 3" Then
  975.             If Not BoardPC(1, 3).BackColor = Color.Lime Then BoardPC(1, 3).BackColor = Color.Blue
  976.         End If
  977.         If one = "1 4" Or two = "1 4" Or three = "1 4" Or four = "1 4" Then
  978.             If Not BoardPC(1, 4).BackColor = Color.Lime Then BoardPC(1, 4).BackColor = Color.Blue
  979.         End If
  980.         '
  981.         '
  982.         If one = "2 1" Or two = "2 1" Or three = "2 1" Or four = "2 1" Then
  983.             If Not BoardPC(2, 1).BackColor = Color.Lime Then BoardPC(2, 1).BackColor = Color.Blue
  984.         End If
  985.         If one = "2 2" Or two = "2 2" Or three = "2 2" Or four = "2 2" Then
  986.             If Not BoardPC(2, 2).BackColor = Color.Lime Then BoardPC(2, 2).BackColor = Color.Blue
  987.         End If
  988.         If one = "2 3" Or two = "2 3" Or three = "2 3" Or four = "2 3" Then
  989.             If Not BoardPC(2, 3).BackColor = Color.Lime Then BoardPC(2, 3).BackColor = Color.Blue
  990.         End If
  991.         If one = "2 4" Or two = "2 4" Or three = "2 4" Or four = "2 4" Then
  992.             If Not BoardPC(2, 4).BackColor = Color.Lime Then BoardPC(2, 4).BackColor = Color.Blue
  993.         End If
  994.         '
  995.         '
  996.         If one = "3 1" Or two = "3 1" Or three = "3 1" Or four = "3 1" Then
  997.             If Not BoardPC(3, 1).BackColor = Color.Lime Then BoardPC(3, 1).BackColor = Color.Blue
  998.         End If
  999.         If one = "3 2" Or two = "3 2" Or three = "3 2" Or four = "3 2" Then
  1000.             If Not BoardPC(3, 2).BackColor = Color.Lime Then BoardPC(3, 2).BackColor = Color.Blue
  1001.         End If
  1002.         If one = "3 3" Or two = "3 3" Or three = "3 3" Or four = "3 3" Then
  1003.             If Not BoardPC(3, 3).BackColor = Color.Lime Then BoardPC(3, 3).BackColor = Color.Blue
  1004.         End If
  1005.         If one = "3 4" Or two = "3 4" Or three = "3 4" Or four = "3 4" Then
  1006.             If Not BoardPC(3, 4).BackColor = Color.Lime Then BoardPC(3, 4).BackColor = Color.Blue
  1007.         End If
  1008.         '
  1009.         '
  1010.         If one = "4 1" Or two = "4 1" Or three = "4 1" Or four = "4 1" Then
  1011.             If Not BoardPC(4, 1).BackColor = Color.Lime Then BoardPC(4, 1).BackColor = Color.Blue
  1012.         End If
  1013.         If one = "4 2" Or two = "4 2" Or three = "4 2" Or four = "4 2" Then
  1014.             If Not BoardPC(4, 2).BackColor = Color.Lime Then BoardPC(4, 2).BackColor = Color.Blue
  1015.         End If
  1016.         If one = "4 3" Or two = "4 3" Or three = "4 3" Or four = "4 3" Then
  1017.             If Not BoardPC(4, 3).BackColor = Color.Lime Then BoardPC(4, 3).BackColor = Color.Blue
  1018.         End If
  1019.         If one = "4 4" Or two = "4 4" Or three = "4 4" Or four = "4 4" Then
  1020.             If Not BoardPC(4, 4).BackColor = Color.Lime Then BoardPC(4, 4).BackColor = Color.Blue
  1021.         End If
  1022.     End Sub
  1023.  
  1024.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  1025.         If TextBox1.Text = "" Then
  1026.             Exit Sub
  1027.         End If
  1028.         If TextBox1.Text = "seeall" Then
  1029.             TextBox1.Clear()
  1030.             Verifica_Trucco_Seeall()
  1031.             Exit Sub
  1032.         End If
  1033.         If TextBox1.Text = "deseeall" Then
  1034.             TextBox1.Clear()
  1035.             For i = 1 To 4
  1036.                 For j = 1 To 4
  1037.                     If BoardPC(i, j).BackColor = Color.Blue Then
  1038.                         BoardPC(i, j).BackColor = Color.White
  1039.                     End If
  1040.                 Next
  1041.             Next
  1042.         End If
  1043.     End Sub
  1044. End Class