droptables is a new rust library for sampling discrete probability distributions in O(1) time using Walker Alias tables generated at compile time!
It's pretty powerful and near optimal in terms of sampling performance, here's a demo of it simulating an OSRS boss:
code: https://github.com/jb55/droptables/blob/master/examples/osrs.rs
ok back to work...
quotingnerd sniped myself even further and made a rust crate for droptables
note1jqz…nrem
no idea why, just some recreational programming before bed. its fast!
gn nostr 😴
![]()
note13jk…wk9c
