Hey, I'm a student with rudimentry knoledge of VB6 and I've a college project where I have to develop a blackjack game. Unfortuanately I've a problem with the method I call the cards I was wondering if any of you would be able to shed some light on the problem.
Option Explicit
Private Sub Command1_Click()
Dim card(5) As Integer
Dim x As Integer
Dim y As Integer
Dim d As Integer
Dim discard(5) As Integer
x = 0
y = 0
d = x - 1
Randomize
card(x) = Int((52 * Rnd) + 1)
Debug.Assert (Val(card(x)))
Do While (y < 5)
Call deal
If discard(x) = card(x) Then
Call deal
End If
y = y + 1
Loop
End Sub
Private Function deal(ByVal card As Integer, x As Integer, y As Integer)
For x = 0 To 4 Step 1
Select Case card(x)
Case Is = 1
Picture1(x).Picture = LoadPicture("F:\Cards\HA.jpg")
Case Is = 2
Picture1(x).Picture = LoadPicture("F:\Cards\H2.jpg")
'same every other card untill 52
End Select
Next y
End Function
Any help will be more than welcome but please keep it somewhat simple so I can understand lol.