Click here to Skip to main content
15,916,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: Comparing objects of different types Pin
Luc Pattyn1-Jul-08 2:11
sitebuilderLuc Pattyn1-Jul-08 2:11 
GeneralRe: Comparing objects of different types Pin
Waleed Eissa1-Jul-08 3:18
Waleed Eissa1-Jul-08 3:18 
GeneralRe: Comparing objects of different types Pin
Luc Pattyn1-Jul-08 3:23
sitebuilderLuc Pattyn1-Jul-08 3:23 
GeneralRe: Comparing objects of different types Pin
Waleed Eissa1-Jul-08 16:05
Waleed Eissa1-Jul-08 16:05 
GeneralRe: Comparing objects of different types Pin
Luc Pattyn1-Jul-08 16:20
sitebuilderLuc Pattyn1-Jul-08 16:20 
QuestionDivide an image Pin
gigahertz20530-Jun-08 14:34
gigahertz20530-Jun-08 14:34 
AnswerRe: Divide an image Pin
Christian Graus30-Jun-08 14:53
protectorChristian Graus30-Jun-08 14:53 
GeneralRe: Divide an image Pin
gigahertz20530-Jun-08 15:21
gigahertz20530-Jun-08 15:21 
GeneralRe: Divide an image Pin
Christian Graus30-Jun-08 15:27
protectorChristian Graus30-Jun-08 15:27 
GeneralRe: Divide an image Pin
gigahertz20530-Jun-08 15:35
gigahertz20530-Jun-08 15:35 
GeneralRe: Divide an image Pin
Christian Graus30-Jun-08 15:36
protectorChristian Graus30-Jun-08 15:36 
GeneralRe: Divide an image Pin
gigahertz20530-Jun-08 15:52
gigahertz20530-Jun-08 15:52 
GeneralRe: Divide an image Pin
Christian Graus30-Jun-08 15:54
protectorChristian Graus30-Jun-08 15:54 
GeneralRe: Divide an image Pin
gigahertz20530-Jun-08 16:01
gigahertz20530-Jun-08 16:01 
GeneralRe: Divide an image Pin
Christian Graus30-Jun-08 16:09
protectorChristian Graus30-Jun-08 16:09 
GeneralRe: Divide an image Pin
gigahertz20530-Jun-08 16:14
gigahertz20530-Jun-08 16:14 
GeneralRe: Divide an image Pin
gigahertz20530-Jun-08 16:56
gigahertz20530-Jun-08 16:56 
GeneralRe: Divide an image Pin
Rao Rafique30-Jun-08 18:27
Rao Rafique30-Jun-08 18:27 
GeneralRe: Divide an image Pin
Christian Graus30-Jun-08 18:57
protectorChristian Graus30-Jun-08 18:57 
QuestionRandom Class Pin
hadad30-Jun-08 13:43
hadad30-Jun-08 13:43 
AnswerRe: Random Class Pin
Christian Graus30-Jun-08 14:04
protectorChristian Graus30-Jun-08 14:04 
GeneralRe: Random Class Pin
Megidolaon1-Jul-08 2:55
Megidolaon1-Jul-08 2:55 
Christian Graus wrote:
To do what you want, build a list of 16 ints, 0-15. Get a random number from 0-15 and pull that index out of the array. For your next number, get a random digit between 0 and 14. And so on.

That wouldn't help much because even if you reduce the number each time, you can still get the same number multiple times (if the first Next() returns 3, nothing stops the next call of the method to return 3 again).

You should save the numbers in a generic List, because it has a variable amount of items and you can still access the items by int indexes.

Then call Next() and after getting the value from the list, remove the index that just has been generated by Next (you need to save its result in some variable).
For the next step, you'd need to create a new random with the changed count of the now smaller List as seed (why can't you change the seed of a random after it's been created anyway?).
QuestionHide "sender" of a mail c# Pin
Member 431105730-Jun-08 10:31
Member 431105730-Jun-08 10:31 
AnswerRe: Hide "sender" of a mail c# Pin
Christian Graus30-Jun-08 10:40
protectorChristian Graus30-Jun-08 10:40 
GeneralRe: Hide "sender" of a mail c# Pin
Bert delaVega30-Jun-08 11:17
Bert delaVega30-Jun-08 11:17 

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.