Easy mistake to make :) It seems logicial for someone to assume that the
number would be between 5 and 55...but it isn't. Go figure...
-sb
"Peter Jausovec" <peter@jausovec.net> wrote in message
news:eRn5MCyJFHA.3420@tk2msftngp13.phx.gbl...[color=blue]
> my bad .. ;)
>
> --
> Regards,
> Peter Jausovec
> (
http://blog.jausovec.net)
> "SB" <stormfire1@yahoo.com> je napisal v sporočilo
> news:%23kJ8g9xJFHA.572@tk2msftngp13.phx.gbl ...[color=green]
>> That will give him a random number between 5 and 54...
>>
>> -sb
>>
>> "Peter Jausovec" <peter@jausovec.net> wrote in message
>> news:ObjEW7xJFHA.2752@TK2MSFTNGP10.phx.gbl...[color=darkred]
>>> Hi,
>>>
>>> Use rnd.Next (5,55) to get the random number from 5 to 55.
>>>
>>> --
>>> Regards,
>>> Peter Jausovec
>>> (
http://blog.jausovec.net)
>>> "BOOGIEMAN" <BOOGIEMANPN@YAHOO.COM> je napisal v sporocilo
>>> news:1emy1vku10ogr.598curnetlmh$.dlg@40tude.net ...
>>>> //Why this doesn't work :
>>>>
>>>> using System;
>>>> using System.Threading;
>>>>
>>>> class RandomObjectDemo
>>>> {
>>>> public static void Main( )
>>>> {
>>>> Thread.Sleep( 1 );
>>>>
>>>> int RND01 = randObj.Next( );
>>>> double RND02 = randObj.NextDouble( );
>>>>
>>>> Console.WriteLine("RND01 = " + RND01 );
>>>> Console.WriteLine("RND02 = " + RND02 );
>>>> }
>>>> }
>>>> ----------------------------------
>>>> //Example above is my rework from this, which works :
>>>>
>>>> using System;
>>>> using System.Threading;
>>>>
>>>> public class RandomObjectDemo
>>>> {
>>>> static void RunIntNDoubleRandoms( Random randObj )
>>>> {
>>>> int RND01 = randObj.Next( );
>>>> double RND02 = randObj.NextDouble( );
>>>>
>>>> Console.WriteLine("RND01 = " + RND01 );
>>>> Console.WriteLine("RND02 = " + RND02 );
>>>> }
>>>>
>>>> static void Main( )
>>>> {
>>>> Thread.Sleep( 1 );
>>>>
>>>> Random autoRand = new Random( );
>>>> RunIntNDoubleRandoms( autoRand );
>>>> }
>>>> }
>>>> ----------------------------------
>>>> I need simpliest way to generate few random numbers.
>>>> Also, how to generate number between (for example) 5 and 55 ?
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]