Re: My FIRST Class!! But it doesn't work as expected - please HELP!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The code i showed i have also run ,,, and it worked as dices in my situation

also nice thingy is that alter after the comments i searched the msdn site
and saw that MS does it the same way

Dim MyValue As Integer
Randomize ' Initialize random-number generator.
MyValue = CInt(Int((6 * Rnd()) + 1)) ' Generate random value between 1 and
6.above is MS code

regards

Michel Posseth [MCP]


"Cap'n Ahab" <space.invader@xxxxxxxxx> wrote in message
news:1136038996.771316.258300@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I have also noticed that instead of using Shared, if I rewrite the
> New() constructor by adding the Randomize() command as below...
>
> Public Sub New()
> Randomize()
> Me.Roll()
> End Sub
>
> and then consume 3 objects based on the Die Class,
>
> Then use the same loop..
>
> Dim One As New Die
> Dim Two As New Die
> Dim Three As New Die
>
> Do
>
> One.Display()
> One.Roll()
> Two.Display()
> Two.Roll()
> Three.Display()
> Three.Roll()
>
> Loop Until UCase(Console.ReadLine) = "Q"
>
> That the results are not random between the die at all!! The numbers
> either are 3 of a the same number OR a pair of numbers an other other
> number - no exceptions. How very odd!
>
> Now I AM confused, lol.
>


.



Relevant Pages