Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rand to Random in 0.14 versioned docs #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import RandomNumbersCrypto from "!!raw-loader!./07.random-numbers-crypto.zig";
Here, we create a new prng using a 64-bit random seed. a, b, c, and d are given
random values via this prng. The expressions giving c and d values are
equivalent. `DefaultPrng` is `Xoroshiro128`; there are other prngs available in
std.rand.
`std.Random`.

<CodeBlock language="zig">{RandomNumbers}</CodeBlock>

Expand All @@ -17,6 +17,6 @@ Cryptographically secure random is also available.
<CodeBlock language="zig">{RandomNumbersCrypto}</CodeBlock>

:::info
We can now use our knowledge of std.rand and [make a guessing game together](/posts/a-guessing-game).
We can now use our knowledge of `std.Random` and [make a guessing game together](/posts/a-guessing-game).

:::
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const std = @import("std");

// hide-end
test "random numbers" {
var prng = std.rand.DefaultPrng.init(blk: {
var prng = std.Random.DefaultPrng.init(blk: {
var seed: u64 = undefined;
try std.posix.getrandom(std.mem.asBytes(&seed));
break :blk seed;
Expand Down