Generate a random boolean
random, vb.net
Solution
Or just simply:
Random rng = new Random();
bool randomBool = rng.Next(0, 2) > 0;
Saves some processing power of parsing text, whereas a simple compare is enough.
Edit: Second parameter is exclusive, so should be `.Next(0, 2)`.
Problem
I am a little stuck with a simple Question: how to generate a simple random Boolean? If am correct, a `Boolean 0 = false and 1 = true`, but how to suse that? Current code: ``` Dim RandGen As New Random Dim RandBool As Boolean RandBool = Boolean.Parse(RandGen.Next(0, 1).tostring) ```