# std.random: add weightedIndex function · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/5bb8c03697fce798a966feb131f6d906863047ae)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 5bb8c03697fce798a966feb131f6d906863047ae

Requested commit: 5bb8c03697fce798a966feb131f6d906863047ae

Commit: 5bb8c03697fce798a966feb131f6d906863047ae

Tree: 29f549a0bdcaf00cbcca65e1b4502555a6b91cc5

Author: Justin Whear

Committer: GitHub

## Message

```
std.random: add weightedIndex function

`weightedIndex` picks from a selection of weighted indices.
```

## Parents

- [0f27836c218ee84f5fb7d4c47dd93a920663c037](https://git.cafe/gitcafe/zig/commit/0f27836c218ee84f5fb7d4c47dd93a920663c037?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/5bb8c03697fce798a966feb131f6d906863047ae?format=markdown)
