0 évaluation0% ont trouvé ce document utile (0 vote)
83 vues1 page
BtnGo.Click is a simple click-based game based on the physics of physics. If a Computer throws a rock, It's a draw, And if It throws paper, It throws scissors.
BtnGo.Click is a simple click-based game based on the physics of physics. If a Computer throws a rock, It's a draw, And if It throws paper, It throws scissors.
BtnGo.Click is a simple click-based game based on the physics of physics. If a Computer throws a rock, It's a draw, And if It throws paper, It throws scissors.
Const PAPER As Integer = 2 Const SCISSORS As Integer = 3 Dim computerThrow As Integer Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click Randomize() computerThrow = Int(3 * Rnd() + 1) If Me.radrock.Checked And computerThrow = ROCK Then Me.lblWinner.Text = "Computer throws Rock. It's a Draw!" ElseIf Me.radrock.Checked And computerThrow = PAPER Then Me.lblWinner.Text = "Computer throws Paper. Computer wins!" ElseIf Me.radscissors.Checked And computerThrow = SCISSORS Then Me.lblWinner.Text = "Computer throws Scissors. You win!" End If If Me.radpaper.Checked And computerThrow = ROCK Then Me.lblWinner.Text = "Computer throws Rock. You win!" ElseIf Me.radpaper.Checked And computerThrow = PAPER Then Me.lblWinner.Text = "Computer throws Paper. It's a Draw!" ElseIf Me.radpaper.Checked And computerThrow = SCISSORS Then Me.lblWinner.Text = "Computer throws Scissors. Computer wins!" End If If Me.radscissors.Checked And computerThrow = ROCK Then Me.lblWinner.Text = "Computer throws Rock. Computer wins!" ElseIf radscissors.Checked And computerThrow = PAPER Then Me.lblWinner.Text = "Computer throws Paper. You win!" ElseIf Me.radscissors.Checked And computerThrow = SCISSORS Then Me.lblWinner.Text = "Computer throws Scissors. It's a Draw!" End If End Sub Private Sub NewGameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewGameToolStripMenuItem.Click lblWinner.Text = "" radpaper.Checked = False radrock.Checked = False radscissors.Checked = False End Sub Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Close() End Sub End Class
Imports Imports Partial Class Inherits Dim As New Dim As New Dim As New Dim As String Dim As Boolean Dim As New Protected Sub Byval As Object Byval As Handles Me If Not Then