diff --git a/lean/src/rng.cpp b/lean/src/rng.cpp index 1fd804b..ce3c1ce 100644 --- a/lean/src/rng.cpp +++ b/lean/src/rng.cpp @@ -17,7 +17,7 @@ void RNG::bytes(unsigned char* ptr, std::size_t len) bool RNG::chance() { - return next_long() <= 0; + return chance(.5); } bool RNG::chance(double d) diff --git a/lean/src/rng/frng.cpp b/lean/src/rng/frng.cpp index 29aa0d2..acf62ac 100644 --- a/lean/src/rng/frng.cpp +++ b/lean/src/rng/frng.cpp @@ -12,8 +12,14 @@ namespace rng { double d = rng.next_double(); long l = rng.next_long(0, 100); + std::array ar; + for(auto& i : ar) i = rng.chance(); + cout << "Sampled: " << d << endl; cout << "Long: " << l << endl; + cout << "Bools: [ "; + for(const auto& i : ar) cout << i << " "; + cout << "]" << endl; } }