Solitaire Question

Need Assistance on Array of Images

Page 1 of 1

2 Replies - 718 Views - Last Post: 06 April 2009 - 09:30 PM Rate Topic: -----

#1 ymilan  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 16-March 09

Solitaire Question

Post icon  Posted 06 April 2009 - 08:01 PM

Hi,

I'm trying to randomize integers in an array of a deck of cards; simple, but I'm also trying to change the display of an array of images of the cards to reflect the randomization. It almost happends when I click the command start button, then does nothing; a window of cards start to appear, but the program freezes.

Here's what I have so far: Warning; I'm kind of a newbie, so forgive please...LOL...thanks.

CardCount = 1
Counter = 0



Do While CardCount < 53 And Counter < 53
CardVal = Int((52 * Rnd) + 1)
If arrDeck(CardVal) = -1 Then
arrDeck(CardVal) = CardCount
Subnum = Counter
Image1(Subnum) = Image1(CardVal)
Image1(CardVal).Visible = True
Counter = Counter + 1

End If
Loop

Is This A Good Question/Topic? 0
  • +

Replies To: Solitaire Question

#2 ymilan  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 16-March 09

Re: Solitaire Question

Posted 06 April 2009 - 09:01 PM

A little more of an explanation;

I placed images in VB on the form as cards in a suit, all lined up; now I'm trying to say when a user presses start button, all the cards are randomized on the screen. Hope this helps.
Was This Post Helpful? 0
  • +
  • -

#3 ymilan  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 16-March 09

Re: Solitaire Question

Posted 06 April 2009 - 09:30 PM

I figured it out; I missed setting a variable to a random number; it now works. Thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1