Modify the Lucky Seven game to present the user with a video poker hand (5 card)
ID: 3541318 • Letter: M
Question
Modify the Lucky Seven game to present the user with a video poker hand (5 card). While you do not have to present graphics for the 5 cards, you may wish to change the main screen graphic to something of your own design. For the cards, each card can be any available from a standard deck of cards. Once a card is used, it cannot be used again in that hand (example: you draw the Jack of Hearts; you cannot draw that same card again). When all 5 cards are shown on screen, allow the user to discard and draw new cards once (up to all 5 cards at a time, but only allow them to change the cards once). Inform the user of their result in a dialog box (example: 3 of a kind or 2 pairs, etc.). After the user clears the result, allow the user to draw a hand again or exit the program.
All programs should have basic menu options that allow the user to exit the program and perform tasks you deem necessary for the program to function correctly. After creating the program, be sure to debug and test your code. When you are finished, submit the code to your instructor.
Explanation / Answer
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Visible = False ' hide picture
Label1.Text = CStr(Int(Rnd() * 10)) ' pick numbers
Label2.Text = CStr(Int(Rnd() * 10)) ' pick numbers
Label3.Text = CStr(Int(Rnd() * 10)) ' pick numbers
' if any number is XXXXX display picture and beep
If (Label1.Text = "7") Or (Label2.Text = "7") _
Or (Label3.Text = "7") Then
PictureBox1.Visible = True
Beep()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.