Skip to content

Instantly share code, notes, and snippets.

@wwin3286tw
Created March 25, 2014 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwin3286tw/9754547 to your computer and use it in GitHub Desktop.
Save wwin3286tw/9754547 to your computer and use it in GitHub Desktop.
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