Click here to Skip to main content
15,868,164 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Crossword generation Pin
Ian Shlasko4-Oct-10 3:56
Ian Shlasko4-Oct-10 3:56 
GeneralRe: Crossword generation Pin
Richard MacCutchan4-Oct-10 5:38
mveRichard MacCutchan4-Oct-10 5:38 
GeneralRe: Crossword generation Pin
Sunasara Imdadhusen15-Feb-11 22:05
professionalSunasara Imdadhusen15-Feb-11 22:05 
AnswerRe: Crossword generation Pin
Luc Pattyn4-Oct-10 3:27
sitebuilderLuc Pattyn4-Oct-10 3:27 
AnswerRe: Crossword generation Pin
Ian Shlasko4-Oct-10 3:59
Ian Shlasko4-Oct-10 3:59 
GeneralRe: Crossword generation Pin
Sunasara Imdadhusen4-Oct-10 19:08
professionalSunasara Imdadhusen4-Oct-10 19:08 
GeneralRe: Crossword generation Pin
eFotografo11-Oct-10 3:55
professionaleFotografo11-Oct-10 3:55 
Questiongenerating random number Pin
fmzl1-Oct-10 22:01
fmzl1-Oct-10 22:01 
Hi,

Im writing a program which has a Random object, I have 3 groups of numbers:

A = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

B = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}

C = {21, 22, 23, 24, 25, 26, 27, 28, 29, 30}

I put the Random object in a "for" loop which will run for n times. How I can make the Random object to generate a number which is in group A for 30% of time, in group B for 60% of time, and in group C for 10% of time. So for example if loop runs 100 times, for 30 times the generated number must be a number that exist in group A and so on.

How I can do that???

Thnx
FMZL

GeneralRe: generating random number Pin
harold aptroot2-Oct-10 1:59
harold aptroot2-Oct-10 1:59 
AnswerRe: generating random number Pin
fmzl2-Oct-10 18:21
fmzl2-Oct-10 18:21 
AnswerRe: generating random number Pin
Luc Pattyn2-Oct-10 3:10
sitebuilderLuc Pattyn2-Oct-10 3:10 
AnswerRe: generating random number Pin
Luc Pattyn2-Oct-10 19:19
sitebuilderLuc Pattyn2-Oct-10 19:19 
AnswerRe: generating random number Pin
fmzl2-Oct-10 21:32
fmzl2-Oct-10 21:32 
GeneralRe: generating random number Pin
mk148822-Oct-10 22:20
mk148822-Oct-10 22:20 
AnswerRe: generating random number Pin
fmzl3-Oct-10 0:14
fmzl3-Oct-10 0:14 
GeneralRe: generating random number Pin
Richard MacCutchan3-Oct-10 1:37
mveRichard MacCutchan3-Oct-10 1:37 
GeneralRe: generating random number Pin
fmzl3-Oct-10 1:49
fmzl3-Oct-10 1:49 
GeneralRe: generating random number Pin
Jeff Connelly20-Dec-10 4:45
Jeff Connelly20-Dec-10 4:45 
QuestionRe: generating random number Pin
fmzl21-Dec-10 12:31
fmzl21-Dec-10 12:31 
AnswerRe: generating random number Pin
Jeff Connelly22-Dec-10 3:59
Jeff Connelly22-Dec-10 3:59 
GeneralRe: generating random number Pin
fmzl22-Dec-10 10:52
fmzl22-Dec-10 10:52 
GeneralRe: generating random number Pin
Jeff Connelly27-Dec-10 4:57
Jeff Connelly27-Dec-10 4:57 
QuestionRe: generating random number Pin
NickHighIQ3-Oct-10 13:37
NickHighIQ3-Oct-10 13:37 
AnswerRe: generating random number Pin
fmzl3-Oct-10 15:07
fmzl3-Oct-10 15:07 
GeneralRe: generating random number Pin
Luc Pattyn3-Oct-10 15:21
sitebuilderLuc Pattyn3-Oct-10 15:21 

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.