Click here to Skip to main content
15,914,160 members
Home / Discussions / C#
   

C#

 
AnswerRe: Just wondering about random numbers Pin
DaveyM6928-Aug-11 13:06
professionalDaveyM6928-Aug-11 13:06 
JokeRe: just woundering about random numbers? Pin
PIEBALDconsult28-Aug-11 14:10
mvePIEBALDconsult28-Aug-11 14:10 
GeneralRe: just woundering about random numbers? Pin
stephen.darling28-Aug-11 14:57
stephen.darling28-Aug-11 14:57 
GeneralRe: just woundering about random numbers? Pin
PIEBALDconsult28-Aug-11 16:50
mvePIEBALDconsult28-Aug-11 16:50 
AnswerRe: just woundering about random numbers? Pin
ljupcecar28-Aug-11 22:55
ljupcecar28-Aug-11 22:55 
AnswerRe: just woundering about random numbers? [modified] Pin
GParkings1-Sep-11 6:33
GParkings1-Sep-11 6:33 
GeneralRe: just woundering about random numbers? Pin
stephen.darling1-Sep-11 13:45
stephen.darling1-Sep-11 13:45 
GeneralRe: just woundering about random numbers? Pin
GParkings1-Sep-11 21:58
GParkings1-Sep-11 21:58 
if you don't need the ball placement then i would recommend sticking with the simple random.next(), A true random number is not possible (at least generated electronically) but the random.next() is pretty good and any system deriving a random number from logic wrapped around a call to that method is at best going to be equally as good but, more likely, introduce bias (which the code i posted above most certainly does).

I posted that code more as a theoretical exercise in how one might simulate a (simplified) roulette wheel, for a system in which bias should be minimal (such as a gambling game in which real money is exchanging hands) it would be better to generate a random number through random.next() and then, having done this, calculate the animation of the ball (so that the ball itself is merely representing the already generated result and not playing a part in generating it)

Keep reading the book, but don't forget to get in there and get your hands dirty. Nothing teaches programming like attempting to program Wink | ;)
GeneralRe: just woundering about random numbers? Pin
stephen.darling2-Sep-11 1:15
stephen.darling2-Sep-11 1:15 
QuestionIs this a good book to learn c#? Pin
stephen.darling28-Aug-11 7:01
stephen.darling28-Aug-11 7:01 
AnswerRe: Is this a good book to learn c#? Pin
Shameel28-Aug-11 8:54
professionalShameel28-Aug-11 8:54 
GeneralRe: Is this a good book to learn c#? Pin
stephen.darling28-Aug-11 11:25
stephen.darling28-Aug-11 11:25 
AnswerRe: Is this a good book to learn c#? Pin
Eddy Vluggen28-Aug-11 9:05
professionalEddy Vluggen28-Aug-11 9:05 
GeneralRe: Is this a good book to learn c#? Pin
stephen.darling28-Aug-11 11:27
stephen.darling28-Aug-11 11:27 
AnswerRe: Is this a good book to learn c#? Pin
BillWoodruff28-Aug-11 19:43
professionalBillWoodruff28-Aug-11 19:43 
Questionintegrate app.config [modified] Pin
Groulien28-Aug-11 4:14
Groulien28-Aug-11 4:14 
AnswerRe: integrate app.config Pin
jschell28-Aug-11 7:49
jschell28-Aug-11 7:49 
QuestionC#.net access Pin
dcof28-Aug-11 3:04
dcof28-Aug-11 3:04 
AnswerRe: C#.net access Pin
PIEBALDconsult28-Aug-11 4:34
mvePIEBALDconsult28-Aug-11 4:34 
GeneralRe: C#.net access Pin
dcof28-Aug-11 8:53
dcof28-Aug-11 8:53 
GeneralRe: C#.net access Pin
PIEBALDconsult28-Aug-11 12:01
mvePIEBALDconsult28-Aug-11 12:01 
GeneralRe: C#.net access Pin
dcof28-Aug-11 13:12
dcof28-Aug-11 13:12 
AnswerRe: C#.net access Pin
jschell28-Aug-11 7:59
jschell28-Aug-11 7:59 
GeneralRe: C#.net access Pin
dcof28-Aug-11 8:55
dcof28-Aug-11 8:55 
QuestionA programe interact with user Pin
Had12327-Aug-11 5:42
Had12327-Aug-11 5:42 

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.