Public Class Form1 Dim Randomizer As New Random Dim Numbers As List(Of Integer) Dim Number1 As Integer Dim Number2 As Integer Dim Number3 As Integer Dim Number4 As Integer Dim Number5 As Integer Dim Number6 As Integer Dim txtNumbers As List(Of Integer) Dim txtNumber1 As Integer Dim txtNumber2 As Integer Dim txtNumber3 As Integer Dim txtNumber4 As Integer Dim txtNumber5 As Integer Dim txtNumber6 As Integer Dim Guess11 As Integer = 0 Dim Guess1 As Integer Dim Guess2 As Integer Dim Guess3 As Integer Dim Guess4 As Integer Dim Guess5 As Integer Dim Guess As Integer Public Sub Naming() Number1 = Randomizer.Next(20) Number2 = Randomizer.Next(20) Number3 = Randomizer.Next(20) Number4 = Randomizer.Next(20) Number5 = Randomizer.Next(20) Number6 = Randomizer.Next(20) txtNumber1 = Val(txt1.Text) txtNumber2 = Val(txt2.Text) txtNumber3 = Val(txt3.Text) txtNumber4 = Val(txt4.Text) txtNumber5 = Val(txt5.Text) txtNumber6 = Val(txt6.Text) End Sub Public Sub Final() Naming() If Number1 = txtNumber1 Then Guess1 = Guess11 + 1 Else Guess1 = Guess11 End If If Number2 = txtNumber2 Then Guess2 = Guess1 + 1 Else Guess2 = Guess1 End If If Number3 = txtNumber3 Then Guess3 = Guess2 + 1 Else Guess3 = Guess2 End If If Number4 = txtNumber4 Then Guess4 = Guess3 + 1 Else Guess4 = Guess3 End If If Number5 = txtNumber5 Then Guess5 = Guess4 + 1 Else Guess5 = Guess4 End If If Number6 = txtNumber6 Then Guess = Guess5 + 1 Else Guess = Guess5 End If Label1.Text = Number1 Label2.Text = Number2 Label3.Text = Number3 Label4.Text = Number4 Label5.Text = Number5 Label6.Text = Number6 End Sub Private Sub cmdGO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGO.Click Final() lblMessage.Text = "You had " & Guess & " guesses.." End Sub End Class
I have to make a game in Visual Basic as a part of a school project. The application makes the user input 6 numbers. It then randomly picks numbers and then compares them with the 6 numbers. It arranges both of them in ascending order. The randomly selected numbers are checked for any repetition. If the user gets 1 right then he makes $2, if he gets 2 right then $20, 3 then $60, 4 then $100, 5 then $200 and if he gets 6 right then he makes $500. To start a game user should pay $ 50. He gets $100 when the game starts. When the user runs out of money then his game ends and he enters his name in high score.
I have coded a part of that. I am stuck. I just want ideas what I can do now!! I will then code it on my own..Please its urgent!! I am stuck here.