soo..... problems:
-some of the cards won't flip (this appears to be random)
-BIG issue working out how to get the program to always use all three cards for computer even when user ends with just two.
i know its messy, and still a long way from finished, but id REALLLYY appreciate some feedback
thx!
Code:Public Class Form2 Dim com1 As Integer 'computers three random cards Dim com2 As Integer 'will be used in case select for card pix Dim com3 As Integer Dim play1 As Integer 'players three random cards Dim play2 As Integer Dim play3 As Integer Dim ace1 As Integer = 1 'lets player choose ace val Dim ace2 As Integer = 11 Dim playScore As Integer = 0 'players total score Dim comScore As Integer = 0 'coms total score Const MIN As Integer = 1 Const MAX As Integer = 13 Dim turn As Integer = 0 Const SCORE As Integer = 21 'goal (equal or under) Private Sub frm21_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Randomize() 'randomize card values com1 = Int((MAX - MIN + 1) * Rnd() * MIN) com2 = Int((MAX - MIN + 1) * Rnd() * MIN) com3 = Int((MAX - MIN + 1) * Rnd() * MIN) play1 = Int((MAX - MIN + 1) * Rnd() * MIN) play2 = Int((MAX - MIN + 1) * Rnd() * MIN) Select Case turn Case 2 play3 = 0 imgCard6.Visible = False Case 3 play3 = Int((MAX - MIN + 1) * Rnd() * MIN) imgCard6.Visible = True End Select btnAgain.Visible = False btnAgain.Enabled = False btnDraw.Visible = True btnDraw.Enabled = True btnCheck.Visible = False btnCheck.Enabled = False End Sub Private Sub btnDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDraw.Click turn += 1 Select Case turn Case 1 lblComDeal.Visible = True imgCard1.Visible = True lblPlayDeal.Visible = True imgCard4.Visible = True Case 2 imgCard1.Visible = True imgCard4.Visible = True imgCard2.Visible = True imgCard5.Visible = True lblChoose.Visible = True btnCheck.Enabled = True btnCheck.Visible = True Case 3 imgCard1.Visible = True imgCard4.Visible = True imgCard2.Visible = True imgCard5.Visible = True imgCard3.Visible = True imgCard6.Visible = True lblChoose.Visible = False btnDraw.Enabled = False End Select End Sub Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click lblChoose.Visible = False Select Case turn Case 2 Select Case com1 Case 1 If Form1.cmbAce.Text = "Play with ace as one" Then comScore += 1 ElseIf Form1.cmbAce.Text = "Play with ace as eleven" Then comScore += 11 End If imgCard1.Image = Blackjack_Fix.My.Resources.sa Case 2 imgCard1.Image = Blackjack_Fix.My.Resources.d_2 comScore += 2 Case 3 imgCard1.Image = Blackjack_Fix.My.Resources.club_3 comScore += 3 Case 4 imgCard1.Image = Blackjack_Fix.My.Resources.h4 comScore += 4 Case 5 imgCard1.Image = Blackjack_Fix.My.Resources.s5 comScore += 5 Case 6 imgCard1.Image = Blackjack_Fix.My.Resources.d_6 comScore += 6 Case 7 imgCard1.Image = Blackjack_Fix.My.Resources.club_7 comScore += 7 Case 8 imgCard1.Image = Blackjack_Fix.My.Resources.h8 comScore += 8 Case 9 imgCard1.Image = Blackjack_Fix.My.Resources.s9 comScore += 9 Case 10 imgCard1.Image = Blackjack_Fix.My.Resources.d_10 comScore += 10 Case 11 imgCard1.Image = Blackjack_Fix.My.Resources.jackdiamond comScore += 11 Case 12 imgCard1.Image = Blackjack_Fix.My.Resources.queenheart comScore += 12 Case 13 imgCard1.Image = Blackjack_Fix.My.Resources.kingheart comScore += 13 End Select Select Case com2 Case 1 If Form1.cmbAce.Text = "Play with ace as one" Then comScore += 1 ElseIf Form1.cmbAce.Text = "Play with ace as eleven" Then comScore += 11 End If imgCard2.Image = Blackjack_Fix.My.Resources.sa Case 2 imgCard2.Image = Blackjack_Fix.My.Resources.d_2 comScore += 2 Case 3 imgCard2.Image = Blackjack_Fix.My.Resources.club_3 comScore += 3 Case 4 imgCard2.Image = Blackjack_Fix.My.Resources.h4 comScore += 4 Case 5 imgCard2.Image = Blackjack_Fix.My.Resources.s5 comScore += 5 Case 6 imgCard2.Image = Blackjack_Fix.My.Resources.d_6 comScore += 6 Case 7 imgCard2.Image = Blackjack_Fix.My.Resources.club_7 comScore += 7 Case 8 imgCard2.Image = Blackjack_Fix.My.Resources.h8 comScore += 8 Case 9 imgCard2.Image = Blackjack_Fix.My.Resources.s9 comScore += 9 Case 10 imgCard2.Image = Blackjack_Fix.My.Resources.d_10 comScore += 10 Case 11 imgCard2.Image = Blackjack_Fix.My.Resources.jackdiamond comScore += 11 Case 12 imgCard2.Image = Blackjack_Fix.My.Resources.queenheart comScore += 12 Case 13 imgCard2.Image = Blackjack_Fix.My.Resources.kingheart comScore += 13 End Select Select Case com3 Case 1 If Form1.cmbAce.Text = "Play with ace as one" Then comScore += 1 ElseIf Form1.cmbAce.Text = "Play with ace as eleven" Then comScore += 11 End If imgCard3.Image = Blackjack_Fix.My.Resources.sa Case 2 imgCard3.Image = Blackjack_Fix.My.Resources.d_2 comScore += 2 Case 3 imgCard3.Image = Blackjack_Fix.My.Resources.club_3 comScore += 3 Case 4 imgCard3.Image = Blackjack_Fix.My.Resources.h4 comScore += 4 Case 5 imgCard3.Image = Blackjack_Fix.My.Resources.s5 comScore += 5 Case 6 imgCard3.Image = Blackjack_Fix.My.Resources.d_6 comScore += 6 Case 7 imgCard3.Image = Blackjack_Fix.My.Resources.club_7 comScore += 7 Case 8 imgCard3.Image = Blackjack_Fix.My.Resources.h8 comScore += 8 Case 9 imgCard3.Image = Blackjack_Fix.My.Resources.s9 comScore += 9 Case 10 imgCard3.Image = Blackjack_Fix.My.Resources.d_10 comScore += 10 Case 11 imgCard3.Image = Blackjack_Fix.My.Resources.jackdiamond comScore += 11 Case 12 imgCard3.Image = Blackjack_Fix.My.Resources.queenheart comScore += 12 Case 13 imgCard3.Image = Blackjack_Fix.My.Resources.kingheart comScore += 13 End Select comScore = com1 + com2 + com3




Reply With Quote
