#[solved] Simple ArrayList shuffle: How?
1 messages · Page 1 of 1 (latest)
1 messages · Page 1 of 1 (latest)
I'm implementing a tool that will follow the instructions at: https://ziglang.org/download/community-mirrors/
Right now I have an ArrayList([]const u8), and I'm returning that from a helper function I wrote
How can I make sure that the contents of the ArrayList are reordered/shuffled randomly? 🤔
var rng = std.Random.DefaultPrng.init(std.crypto.random.int(u64));
rng.random().shuffle([]const u8, result.buffer.items);
```sanity check: is this a good idea? 🤔
That’s fine