looking for source code test
looking for source code test
Dim myMoney As Integer = 10000, myBid As Integer = 100 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load TextBox5.Text = myMoney TextBox4.Text = myBid End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If (Integer.Parse(TextBox4.Text) >= Integer.Parse(TextBox5.Text)) Then MsgBox("You can not bid more money than you have!") Else myBid = Integer.Parse(TextBox4.Text) updateSlots() checkSlots() TextBox5.Text = myMoney End If End Sub
Private Function updateSlots() Dim rand As Random = New Random() Dim slots As New List(Of TextBox) slots.Add(TextBox1) slots.Add(TextBox2) slots.Add(TextBox3) For i As Integer = 0 To 2 Dim r As Integer = rand.Next(9) slots(i).Text = r r = Nothing Next End Function
Private Function checkSlots() Dim t1 As Integer = TextBox1.Text, t2 As Integer = TextBox2.Text, t3 As Integer = TextBox3.Text If ((t1 = t2) And t2 = t3) Then Label4.Text = "Triple Money!" myMoney += (myBid * 3) ElseIf ((t1 = t2) Or (t1 = t3) Or (t2 = t3)) Then Label4.Text = "Double Money!" myMoney += (myBid * 2) Else Label4.Text = "Bid Lost." myMoney -= myBid End If End Function
Public Class Form1 Dim myMoney As Integer = 10000, myBid As Integer = 100 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load TextBox5.Text = myMoney TextBox4.Text = myBid End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If (Integer.Parse(TextBox4.Text) >= Integer.Parse(TextBox5.Text)) Then MsgBox("You can not bid more money than you have!") Else myBid = Integer.Parse(TextBox4.Text) updateSlots() checkSlots() TextBox5.Text = myMoney End If End Sub Private Function updateSlots() Dim rand As Random = New Random() Dim slots As New List(Of TextBox) slots.Add(TextBox1) slots.Add(TextBox2) slots.Add(TextBox3) For i As Integer = 0 To 2 Dim r As Integer = rand.Next(9) slots(i).Text = r r = Nothing Next End Function Private Function checkSlots() Dim t1 As Integer = TextBox1.Text, t2 As Integer = TextBox2.Text, t3 As Integer = TextBox3.Text If ((t1 = t2) And t2 = t3) Then Label4.Text = "Triple Money!" myMoney += (myBid * 3) ElseIf ((t1 = t2) Or (t1 = t3) Or (t2 = t3)) Then Label4.Text = "Double Money!" myMoney += (myBid * 2) Else Label4.Text = "Bid Lost." myMoney -= myBid End If End Function End Class
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.