An example of how to implement a random choice with weighted distribution. Demonstrated in multiple languages.
-
Check the issues list for a list of languages currently available.
-
Comment that you've chosen that language to port. Please choose only one language to leave room for others wanting to contribute. Feel free to add an issue using the template for any language not yet listed.
-
Implement random weighted choice with your chosen language. You can use any example choices or weights you'd like. Make sure the example tests the implementation at least 100 times and outputs the results. Check out the c++ implementation for an example.
-
Send a PR request!