You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The shuffle function never shuffles the first element into the first spot. #6
use macroquad::{logging as log, rand::ChooseRandom};
#[macroquad::main(window_conf)]
async fn main() {
let mut results = [0;4];
for _ in 0..100 {
let mut test = vec![0,1,2,3];
test.shuffle();
results[test[0]] += 1;
}
log::info!("results: {:?}", results);
}
Activity
bwinton commentedon Feb 11, 2021
(I added a copy-ish of the function to my code that looks like:
and that gives much better results, for what it's worth. 🙂)