Click here to Skip to main content
16,004,974 members
Home / Discussions / C#
   

C#

 
Question[Solved] Generating pairs of bools does not work as I expect it to [modified] Pin
Vikram A Punathambekar22-Mar-07 2:41
Vikram A Punathambekar22-Mar-07 2:41 
AnswerRe: Generating pairs of bools does not work as I expect it to Pin
Corinna John22-Mar-07 2:54
Corinna John22-Mar-07 2:54 
GeneralMaybe it's not the proper solution Pin
CPallini22-Mar-07 3:01
mveCPallini22-Mar-07 3:01 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Vikram A Punathambekar22-Mar-07 3:19
Vikram A Punathambekar22-Mar-07 3:19 
AnswerRe: Generating pairs of bools does not work as I expect it to Pin
CPallini22-Mar-07 2:57
mveCPallini22-Mar-07 2:57 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Vikram A Punathambekar22-Mar-07 3:20
Vikram A Punathambekar22-Mar-07 3:20 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Dan Neely22-Mar-07 3:26
Dan Neely22-Mar-07 3:26 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
CPallini22-Mar-07 3:55
mveCPallini22-Mar-07 3:55 
If your constraint applies only to the function signature then modifty its body as follows:

static System.Random _randomNumberGenerator = new System.Random((int)DateTime.Now.Ticks);

public static bool GetRandomBool()
{
  int randomNumber = _randomNumberGenerator.Next();
  if(randomNumber % 2 == 1)
  {
    return true;
  }
  else
  {
    return false;
  }
}


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Vikram A Punathambekar22-Mar-07 4:53
Vikram A Punathambekar22-Mar-07 4:53 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
CPallini22-Mar-07 5:16
mveCPallini22-Mar-07 5:16 
AnswerRe: Generating pairs of bools does not work as I expect it to Pin
Russell Jones22-Mar-07 3:05
Russell Jones22-Mar-07 3:05 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Vikram A Punathambekar22-Mar-07 3:21
Vikram A Punathambekar22-Mar-07 3:21 
AnswerRe: Generating pairs of bools does not work as I expect it to Pin
Corinna John22-Mar-07 4:34
Corinna John22-Mar-07 4:34 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Vikram A Punathambekar22-Mar-07 4:58
Vikram A Punathambekar22-Mar-07 4:58 
AnswerRe: Generating pairs of bools does not work as I expect it to Pin
J4amieC22-Mar-07 4:50
J4amieC22-Mar-07 4:50 
GeneralRe: Generating pairs of bools does not work as I expect it to Pin
Vikram A Punathambekar22-Mar-07 4:56
Vikram A Punathambekar22-Mar-07 4:56 
AnswerRe: Generating pairs of bools does not work as I expect it to Pin
Russell Jones22-Mar-07 5:01
Russell Jones22-Mar-07 5:01 
Questionhow to get mp3 file total time Pin
Member 394958222-Mar-07 2:11
Member 394958222-Mar-07 2:11 
AnswerRe: how to get mp3 file total time Pin
Dawid Mazuruk22-Mar-07 3:58
Dawid Mazuruk22-Mar-07 3:58 
QuestionFill data to another table from Dataset Pin
Sarfaraj Ahmed22-Mar-07 1:43
Sarfaraj Ahmed22-Mar-07 1:43 
AnswerRe: Fill data to another table from Dataset Pin
rah_sin22-Mar-07 2:26
professionalrah_sin22-Mar-07 2:26 
GeneralRe: Fill data to another table from Dataset Pin
Sarfaraj Ahmed22-Mar-07 2:51
Sarfaraj Ahmed22-Mar-07 2:51 
QuestionKnowing who is a parent of a control Pin
sinosoidal22-Mar-07 1:31
sinosoidal22-Mar-07 1:31 
AnswerRe: Knowing who is a parent of a control Pin
Stefan Troschuetz22-Mar-07 2:03
Stefan Troschuetz22-Mar-07 2:03 
GeneralRe: Knowing who is a parent of a control Pin
sinosoidal22-Mar-07 2:15
sinosoidal22-Mar-07 2:15 

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.