Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
AnswerRe: For Disappear .. Pin
KevinMac25-Nov-06 19:22
KevinMac25-Nov-06 19:22 
GeneralRe: For Disappear .. Pin
davvid25-Nov-06 19:35
davvid25-Nov-06 19:35 
GeneralRe: For Disappear .. Pin
davvid25-Nov-06 19:36
davvid25-Nov-06 19:36 
GeneralRe: For Disappear .. Pin
Guffa26-Nov-06 4:08
Guffa26-Nov-06 4:08 
Questionis file readable Pin
justintimberlake25-Nov-06 18:49
justintimberlake25-Nov-06 18:49 
AnswerRe: is file readable Pin
Stefan Troschuetz25-Nov-06 21:26
Stefan Troschuetz25-Nov-06 21:26 
Questionhow to come out the pic randomly in picture boxes? Pin
davvid25-Nov-06 17:47
davvid25-Nov-06 17:47 
AnswerRe: how to come out the pic randomly in picture boxes? Pin
S. Senthil Kumar25-Nov-06 18:21
S. Senthil Kumar25-Nov-06 18:21 
You could use System.Random[^] to generate the random numbers. The Next[^] method has an overload that allows you to specify the maximum value (12, in your case). You could generate 12 random numbers in that range and use them to shuffle the elements in the array.

class CardShuffler
{
   Random randomGen = new Random();
   Card []cards = new Card[12];

   public void Shuffle()
   {
      for (int i = 0; i<cards.Length; ++i)
      {
         int newIndex = randomGen.NextInt(i, 12);
         // Swap element at newIndex with element at i
         Card temp = cards[newIndex];
         cards[newIndex] = cards[i];
         cards[i] = temp;
      }
   }
}


Regards
Senthil [MVP - Visual C#]
_____________________________
My Blog | My Articles | My Flickr | WinMacro

GeneralRe: how to come out the pic randomly in picture boxes? Pin
davvid25-Nov-06 18:38
davvid25-Nov-06 18:38 
Questionpls help me with my card game Pin
davvid25-Nov-06 15:22
davvid25-Nov-06 15:22 
AnswerRe: pls help me with my card game Pin
Christian Graus25-Nov-06 22:30
protectorChristian Graus25-Nov-06 22:30 
QuestionContext Menue Pin
Mohammed Elkholy25-Nov-06 14:19
Mohammed Elkholy25-Nov-06 14:19 
AnswerRe: Context Menue Pin
Paul Conrad25-Nov-06 18:23
professionalPaul Conrad25-Nov-06 18:23 
QuestionFTP LIST problem Pin
Monin D.25-Nov-06 14:03
Monin D.25-Nov-06 14:03 
AnswerRe: FTP LIST problem Pin
S. Senthil Kumar25-Nov-06 18:27
S. Senthil Kumar25-Nov-06 18:27 
GeneralRe: FTP LIST problem Pin
Monin D.25-Nov-06 21:51
Monin D.25-Nov-06 21:51 
Questionslowing down the process Pin
Argus225-Nov-06 11:55
Argus225-Nov-06 11:55 
AnswerRe: slowing down the process Pin
Amar Chaudhary25-Nov-06 12:18
Amar Chaudhary25-Nov-06 12:18 
GeneralRe: slowing down the process Pin
Argus225-Nov-06 12:26
Argus225-Nov-06 12:26 
GeneralRe: slowing down the process Pin
Rob Graham25-Nov-06 12:28
Rob Graham25-Nov-06 12:28 
GeneralRe: slowing down the process Pin
Argus225-Nov-06 12:38
Argus225-Nov-06 12:38 
GeneralRe: slowing down the process Pin
Rob Graham25-Nov-06 13:04
Rob Graham25-Nov-06 13:04 
AnswerRe: slowing down the process Pin
Guffa25-Nov-06 13:22
Guffa25-Nov-06 13:22 
AnswerRe: slowing down the process Pin
Martin2326-Nov-06 5:13
Martin2326-Nov-06 5:13 
GeneralRe: slowing down the process Pin
Argus226-Nov-06 13:34
Argus226-Nov-06 13:34 

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.