I have a couple quick questions with the program that I am doing. This program is a hi\lo program and here are my remaining issues...
1. When I click the high or low button in my program it does not make changes to my token (I want the default tokens to be 100 and added 100 to the text property of my textbox so want to make sure I did that right)
2. In my program it only shows 13 possibilities but want to have the ability to add more
3. I also would like to change 1 to ace, 11 to jack, 12 to queen, and 13 to king and would like to get some assistance with that as well
I think I have everything else taken care of but this is the code I have...
Code:Public Class Form1 Private randomgen As New Random Private cards As Integer Private cardpicked As Object Private clicked As Integer = 1 Private used1, used2, used3, used4, used5, used6, used7, used8, used9, used10 As Integer Private myList As New List(Of Integer) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For index As Integer = 1 To 13 myList.Add(index) Next ShuffleCards(1000) End Sub Private Sub ShuffleCards(ByVal NumberOfTimes As Integer) Dim listIndex As Integer Dim output As String = "" Dim currentCard As Integer Try For index As Integer = 1 To NumberOfTimes listIndex = randomgen.Next(1, 14) - 1 'Get a currentCard currentCard = myList.Item(listIndex) 'Remove it at a RANDOM position. myList.RemoveAt(listIndex) 'Add it back to the list at the end of the list. myList.Add(currentCard) Next For cardNumber As Integer = 1 To 13 output &= myList(cardNumber - 1) & ControlChars.NewLine Next Catch End Try MessageBox.Show("Card Order is now" & ControlChars.NewLine & output) End Sub Private Sub PickCard() Dim cardNumber As Integer If myList.Count > 0 Then cardNumber = myList.Item(0) myList.RemoveAt(0) ElseIf myList.Count = 0 Then MessageBox.Show("No more cards left sorry!!") Exit Sub End If MessageBox.Show("CardNumber is now " & cardNumber) clicked = clicked + 1 End Sub Private Sub cardCheckButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cardCheckButton.Click PickCard() End Sub Private Sub highButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles highButton.Click ' Dim cardNumber As Integer 'If cardNumber >> cardpicked Then 'tokensTextBox = 100 + 10 'ElseIf cardNumber << cardpicked Then 'tokensTextBox = 100 - 10 'End If End Sub Private Sub tokensTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tokensTextBox.TextChanged 'START WITH 100 TOKENS End Sub Private Sub lowButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lowButton.Click 'Dim cardNumber As Integer 'If cardNumber >> cardpicked Then ' tokensTextBox = tokensTextBox - 10 'ElseIf cardNumber << cardpicked Then ' tokensTextBox = 100 + 10 End Sub Private Sub quitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles quitButton.Click Me.Close() End Sub End Class




Reply With Quote