Created
March 25, 2014 03:06
-
-
Save wwin3286tw/9754547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
Timer1.Enabled = True | |
Timer2.Enabled = True | |
Button1.Enabled = False | |
End Sub | |
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick | |
Randomize() | |
Dim a = Int(Rnd() * 6) + 1 | |
Label3.Text = a | |
End Sub | |
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick | |
Randomize() | |
Dim a = Int(Rnd() * 6) + 1 | |
Label4.Text = a | |
End Sub | |
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load | |
End Sub | |
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click | |
distim() | |
Dim c# = 0 | |
c = Val(Label3.Text) + Val(Label4.Text) | |
Label5.Text = "結果=" & c & "," & If(c < 6, "輸了", "贏了") | |
End Sub | |
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click | |
distim() | |
Dim c# = 0 | |
c = Val(Label3.Text) + Val(Label4.Text) | |
Label5.Text = "結果=" & c & "," & If(c > 6, "輸了", "贏了") | |
End Sub | |
Sub distim() | |
Timer1.Enabled = False | |
Timer2.Enabled = False | |
End Sub | |
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click | |
Button1.Enabled = True | |
Label5.Text = "結果=" | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment