Click here to Skip to main content
15,886,518 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Getting Image coordinates when image is zoomed Pin
Jarno Burger27-May-09 6:53
Jarno Burger27-May-09 6:53 
GeneralRe: Getting Image coordinates when image is zoomed Pin
Alan Streisel29-May-09 2:58
Alan Streisel29-May-09 2:58 
GeneralRe: Getting Image coordinates when image is zoomed Pin
DidiKunz29-May-09 4:17
DidiKunz29-May-09 4:17 
GeneralRe: Getting Image coordinates when image is zoomed Pin
Alan Streisel29-May-09 5:01
Alan Streisel29-May-09 5:01 
GeneralRe: Getting Image coordinates when image is zoomed Pin
DidiKunz29-May-09 6:49
DidiKunz29-May-09 6:49 
QuestionPlease help a newbie that is totally confused.... Pin
ymilan26-May-09 6:27
ymilan26-May-09 6:27 
GeneralRe: Please help a newbie that is totally confused.... Pin
Kschuler26-May-09 7:30
Kschuler26-May-09 7:30 
AnswerRe: Please help a newbie that is totally confused.... Pin
Guffa26-May-09 11:20
Guffa26-May-09 11:20 
Here is one problem:
Card1 = Int(51 * Rnd)

This will give you a random number with 51 possible values, i.e. from 0 to 50. That means that you are never touching the last card in the deck.

You are doing 100 times as much work as you need to in order to shuffle the deck. You don't have to make more than 51 swaps to completely shuffle the deck, you just have to make sure that each card has an equal chance to be swapped into each position in the deck:
For card1 = 0 To 50
   card2 = card1 + Int((52 - card1) * Rnd)
   If card1 <> card2 Then
      Temp = Image1(card1).Picture
      Image1(card1).Picture = Image1(card2).Picture
      Image1(card2).Picture = Temp
   End If
Next Index


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Please help a newbie that is totally confused.... Pin
ymilan27-May-09 12:59
ymilan27-May-09 12:59 
AnswerRe: Please help a newbie that is totally confused.... Pin
Jarno Burger28-May-09 1:16
Jarno Burger28-May-09 1:16 
GeneralRe: Please help a newbie that is totally confused.... Pin
ymilan28-May-09 2:29
ymilan28-May-09 2:29 
GeneralRe: Please help a newbie that is totally confused.... Pin
ymilan28-May-09 2:58
ymilan28-May-09 2:58 
GeneralRe: Please help a newbie that is totally confused.... Pin
Jarno Burger28-May-09 3:55
Jarno Burger28-May-09 3:55 
GeneralRe: Please help a newbie that is totally confused.... Pin
ymilan28-May-09 11:57
ymilan28-May-09 11:57 
GeneralRe: Please help a newbie that is totally confused.... Pin
Jarno Burger28-May-09 23:23
Jarno Burger28-May-09 23:23 
QuestionGet the last line from a constantly updating textbox Pin
The Mighty Atom26-May-09 5:21
The Mighty Atom26-May-09 5:21 
AnswerRe: Get the last line from a constantly updating textbox Pin
Luc Pattyn26-May-09 5:45
sitebuilderLuc Pattyn26-May-09 5:45 
GeneralRe: Get the last line from a constantly updating textbox Pin
The Mighty Atom26-May-09 6:59
The Mighty Atom26-May-09 6:59 
GeneralRe: Get the last line from a constantly updating textbox Pin
Luc Pattyn26-May-09 7:14
sitebuilderLuc Pattyn26-May-09 7:14 
AnswerRe: Get the last line from a constantly updating textbox Pin
Jarno Burger28-May-09 4:10
Jarno Burger28-May-09 4:10 
GeneralRe: Get the last line from a constantly updating textbox [modified] Pin
The Mighty Atom28-May-09 6:36
The Mighty Atom28-May-09 6:36 
GeneralRe: Get the last line from a constantly updating textbox Pin
DidiKunz29-May-09 4:22
DidiKunz29-May-09 4:22 
GeneralRe: Get the last line from a constantly updating textbox Pin
The Mighty Atom1-Jun-09 3:22
The Mighty Atom1-Jun-09 3:22 
GeneralRe: Get the last line from a constantly updating textbox Pin
DidiKunz1-Jun-09 8:01
DidiKunz1-Jun-09 8:01 
GeneralRe: Get the last line from a constantly updating textbox Pin
The Mighty Atom1-Jun-09 8:20
The Mighty Atom1-Jun-09 8:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.