Tic Tac Toe spel (3 / 5 steg)
Steg 3: När spelet startar
Private Sub Open_TwoPlayerForm(sender As System.Object, e As System.EventArgs) hanterar Me.Activated End Sub
"Detta är koden för vad som händer när TwoPlayerForm öppnas".
34. infoga följande kod mellan privata Sub och End Sub:
Dim tur som nya slumpmässiga Om TurnResult = 1 då Om TurnResult = 2 då
Dim TurnResult som heltal = Turn.Next (1, 3)
PlayerTurnLabel.Text = "Röd Turn"
Slut om
PlayerTurnLabel.Text = "Blå tur"
Slut om
"Väljer slumpmässigt spelaren vem som går först."
OvalShape1.Visible = False
OvalShape2.Visible = False
OvalShape3.Visible = False
OvalShape4.Visible = False
OvalShape5.Visible = False
OvalShape6.Visible = False
OvalShape7.Visible = False
OvalShape8.Visible = False
OvalShape9.Visible = False
LineShape1.Visible = False
LineShape2.Visible = False
LineShape3.Visible = False
LineShape4.Visible = False
LineShape5.Visible = False
LineShape6.Visible = False
LineShape7.Visible = False
LineShape8.Visible = False
LineShape9.Visible = False
LineShape10.Visible = False
LineShape11.Visible = False
LineShape12.Visible = False
LineShape13.Visible = False
LineShape14.Visible = False
LineShape15.Visible = False
LineShape16.Visible = False
LineShape17.Visible = False
LineShape18.Visible = False
"Gör alla cirklar och korsar osynlig."