# Solitaire Question

Page 1 of 1

## 2 Replies - 1002 Views - Last Post: 06 April 2009 - 09:30 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=97704&amp;s=eacdd73ddcae2da1edae58a38fb12ea5&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 ymilan

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

# Solitaire Question

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

Reputation: 1
• 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.

### #3 ymilan

Reputation: 1
• 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.