Click here to Skip to main content
15,915,328 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Crystal ReportProblem with vb.net with MS access Pin
hrishiS26-May-09 20:09
hrishiS26-May-09 20:09 
GeneralRe: Crystal ReportProblem with vb.net with MS access Pin
Anubhava Dimri27-May-09 20:14
Anubhava Dimri27-May-09 20:14 
GeneralRe: Crystal ReportProblem with vb.net with MS access Pin
hrishiS28-May-09 0:11
hrishiS28-May-09 0:11 
AnswerRe: Crystal ReportProblem with vb.net with MS access Pin
Kschuler27-May-09 9:27
Kschuler27-May-09 9:27 
GeneralRe: Crystal ReportProblem with vb.net with MS access Pin
hrishiS27-May-09 18:39
hrishiS27-May-09 18:39 
GeneralRe: Crystal ReportProblem with vb.net with MS access Pin
Anubhava Dimri28-May-09 18:43
Anubhava Dimri28-May-09 18:43 
GeneralRe: Crystal ReportProblem with vb.net with MS access Pin
hrishiS31-May-09 18:48
hrishiS31-May-09 18:48 
QuestionFunction doesn't return a value Pin
A Wyatt26-May-09 16:20
A Wyatt26-May-09 16:20 
AnswerRe: Function doesn't return a value Pin
Dave Kreskowiak26-May-09 16:28
mveDave Kreskowiak26-May-09 16:28 
GeneralRe: Function doesn't return a value Pin
A Wyatt26-May-09 16:48
A Wyatt26-May-09 16:48 
QuestionLittle problem with database Pin
breikascool26-May-09 13:33
breikascool26-May-09 13:33 
AnswerRe: Little problem with database Pin
Henry Minute26-May-09 15:01
Henry Minute26-May-09 15:01 
GeneralRe: Little problem with database Pin
breikascool27-May-09 9:07
breikascool27-May-09 9:07 
QuestionDrag and drop makes a ping sound Pin
Jarno Burger26-May-09 9:14
Jarno Burger26-May-09 9:14 
QuestionGetting Image coordinates when image is zoomed Pin
Alan Streisel26-May-09 8:16
Alan Streisel26-May-09 8:16 
AnswerRe: Getting Image coordinates when image is zoomed Pin
Jarno Burger26-May-09 9:11
Jarno Burger26-May-09 9:11 
GeneralRe: Getting Image coordinates when image is zoomed Pin
Alan Streisel27-May-09 2:43
Alan Streisel27-May-09 2:43 
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.

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.