Sei sulla pagina 1di 4

Public Class Form1 Dim b As Integer Dim x, y, z As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.

E ventArgs) Handles Button1.Click PictureBox1.ImageLocation = Application.StartupPath & "\images\bato.png" Timer1.Enabled = True y = 0 z = 1 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.E ventArgs) Handles Button2.Click PictureBox1.ImageLocation = Application.StartupPath & "\images\gunting.p ng" Timer2.Enabled = True y = 0 z = 1 End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.E ventArgs) Handles Button3.Click PictureBox1.ImageLocation = Application.StartupPath & "\images\papel.png " Timer3.Enabled = True y = 0 z = 1 End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.Eve ntArgs) Handles Timer1.Tick x = Int(3 * Rnd() + 1) If x = 1 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\bato. png" ElseIf x = 2 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\gunti ng.png" ElseIf x = 3 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\papel .png" End If If y >= 100 Then Timer1.Enabled = False Call Score() End If x = Int((Second(Now) \ 20) * Rnd() + 1) y = y + x End Sub Private Sub score() If z = 1 And x = 1 Then MsgBox("Tabla") TextBox3.Text = Val(TextBox3.Text) + 1 ElseIf z = 1 And x = 2 Then MsgBox("Panalo ka") TextBox1.Text = Val(TextBox1.Text) + 1 ElseIf z = 1 And x = 3 Then MsgBox("Talo ka") TextBox2.Text = Val(TextBox2.Text) + 1

End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.Eve ntArgs) Handles Timer2.Tick x = Int(3 * Rnd() + 1) If x = 3 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\bato. png" ElseIf x = 1 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\gunti ng.png" ElseIf x = 2 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\papel .png" End If If y >= 100 Then Timer2.Enabled = False Call score() End If x = Int((Second(Now) \ 20) * Rnd() + 1) y = y + x End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.Eve ntArgs) Handles Timer3.Tick x = Int(3 * Rnd() + 1) If x = 2 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\bato. png" ElseIf x = 3 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\gunti ng.png" ElseIf x = 1 Then PictureBox2.ImageLocation = Application.StartupPath & "\images\papel .png" End If If y >= 100 Then Timer3.Enabled = False Call score() End If x = Int((Second(Now) \ 20) * Rnd() + 1) y = y + x End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As S ystem.EventArgs) Handles TextBox1.TextChanged If Val(Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text)) = " 15" Then If TextBox1.Text > TextBox2.Text Then MessageBox.Show("GAME OVER YOU WIN", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ElseIf TextBox2.Text > TextBox1.Text Then MessageBox.Show("GAME OVER YOU LOSE", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = ""

ElseIf TextBox2.Text = TextBox1.Text Then MessageBox.Show("GAME OVER ITS A TIED", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End If End If End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As S ystem.EventArgs) Handles TextBox2.TextChanged If Val(Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text)) = " 15" Then If TextBox1.Text > TextBox2.Text Then MessageBox.Show("GAME OVER YOU WIN", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ElseIf TextBox2.Text > TextBox1.Text Then MessageBox.Show("GAME OVER YOU LOSE", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ElseIf TextBox2.Text = TextBox1.Text Then MessageBox.Show("GAME OVER ITS A TIED", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End If End If End Sub Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As S ystem.EventArgs) Handles TextBox3.TextChanged If Val(Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text)) = " 15" Then If TextBox1.Text > TextBox2.Text Then MessageBox.Show("GAME OVER YOU WIN", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ElseIf TextBox2.Text > TextBox1.Text Then MessageBox.Show("GAME OVER YOU LOSE", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ElseIf TextBox2.Text = TextBox1.Text Then MessageBox.Show("GAME OVER ITS A TIED", "JackNPoy") TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End If End If End Sub End Class

Potrebbero piacerti anche