summary refs log tree commit diff
path: root/bin/beef.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-28 17:13:16 -0400
committerJune McEnroe <june@causal.agency>2019-08-28 17:13:16 -0400
commit21878fc139bd39bfb476f2c6f76ca9b0c15d6ec8 (patch)
tree85f6ad387ac10524177f8767cc88c66c18a5679c /bin/beef.c
parentRemove wake (diff)
downloadsrc-21878fc139bd39bfb476f2c6f76ca9b0c15d6ec8.tar.gz
src-21878fc139bd39bfb476f2c6f76ca9b0c15d6ec8.zip
Use rand(3) in beef
Diffstat (limited to 'bin/beef.c')
-rw-r--r--bin/beef.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/beef.c b/bin/beef.c
index 556742d9..b2579b73 100644
--- a/bin/beef.c
+++ b/bin/beef.c
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysexits.h>
+#include <time.h>
 
 enum {
 	Cols = 80,
@@ -78,7 +79,7 @@ static bool step(void) {
 		return true;
 	}
 
-	if (ch == '?') ch = "><^v"[arc4random_uniform(4)];
+	if (ch == '?') ch = "><^v"[rand() % 4];
 
 	long x, y, v;
 	switch (ch) {
@@ -114,6 +115,7 @@ static bool step(void) {
 }
 
 int main(int argc, char *argv[]) {
+	srand(time(NULL));
 	memset(page, ' ', sizeof(page));
 
 	FILE *file = stdin;