Skip to content

Commit 5675292

Browse files
committed
seed rand in sample.c
1 parent e749350 commit 5675292

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Amplified Loaded Dice Roller
22

33
This repository contains a reference implementation in C of the Amplified
4-
Loaded Dice Roller (ALDR), a fast algorithm for generating rolls an
4+
Loaded Dice Roller (ALDR), a fast algorithm for generating rolls of an
55
$n$-sided die with rational probabilities.
66

77
## Building

sample.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99

1010
#include <stdio.h>
1111
#include <stdlib.h>
12+
#include <time.h>
13+
1214
#include "aldr.h"
1315

1416
int main(int argc, char **argv) {
1517
if (argc < 3) {
1618
printf("usage: %s <n> <dist>\n", argv[0]);
1719
exit(0);
1820
}
21+
srand(time(NULL));
1922
int num_samples = atoi(argv[1]);
2023

2124
// Parse the distribution.

0 commit comments

Comments
 (0)