|
1 | 1 | # The Amplified Loaded Dice Roller |
2 | 2 |
|
3 | | -This repository contains a reference implementation in C |
4 | | -of the Amplified Loaded Dice Roller (ALDR), |
5 | | -a fast algorithm for rolling an $n$-sided die. |
| 3 | +This repository contains a reference implementation in C of the Amplified |
| 4 | +Loaded Dice Roller (ALDR), a fast algorithm for generating rolls an |
| 5 | +$n$-sided die with rational probabilities. |
6 | 6 |
|
7 | | -## Building and Installing |
| 7 | +## Building |
8 | 8 |
|
9 | 9 | The library can be built by running |
10 | 10 |
|
11 | 11 | $ make all |
12 | 12 |
|
13 | | -This command creates several artifacts in the `build/` directory: |
| 13 | +This command creates the following artifacts in the `build/` directory: |
14 | 14 |
|
15 | | -1. `build/lib/libaldr.a`: A static C library for C programs that use ALDR. |
| 15 | +| Folder | Description | |
| 16 | +| -------- | ------- | |
| 17 | +| `build/bin/aldr` | Executable for command line interface to ALDR | |
| 18 | +| `build/include` | Header files for C programs that use ALDR | |
| 19 | +| `build/lib/libaldr.a` | Static library for C programs that use ALDR | |
16 | 20 |
|
17 | | -1. `build/include`: Contains header files for C programs that use ALDR. |
18 | | - |
19 | | -1. `build/bin`: Contains the executable for a command line interface to ALDR. |
20 | 21 |
|
21 | 22 | ## Usage |
22 | 23 |
|
@@ -47,14 +48,15 @@ int main(int argc, char **argv) { |
47 | 48 |
|
48 | 49 | ## Usage (Command Line Interface) |
49 | 50 |
|
50 | | -The executable has the following command line interface: |
| 51 | +The executable in `build/bin/aldr` has the following command line interface: |
51 | 52 |
|
52 | 53 | ``` |
53 | | -usage: ./build/bin/aldr num_samples ...distribution... |
| 54 | +usage: ./build/bin/aldr <n> <dist> |
54 | 55 | ``` |
55 | 56 |
|
56 | | -where `num_samples` is the number of samples to draw; |
57 | | -`...distribution...` is a space-separated list of positive integer weights. |
| 57 | +where `<n>` is an integer denoting the number of samples to draw; and |
| 58 | +`<dist>` is a space-separated list of positive integers weights for |
| 59 | +the desired discrete distribution. |
58 | 60 |
|
59 | 61 | For example, to generate 90 samples from { 1, 1, 2, 3, 2 }, run the following: |
60 | 62 |
|
|
0 commit comments