From 1b9820612a98f266bb90635c60c40943697826ee Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 10 Jun 2019 02:58:53 -0500 Subject: added ability to set seed in dungen and commented out sleep that was used for watching the generating --- share/hackvr/examples/dungen/dungen | Bin 17176 -> 0 bytes share/hackvr/examples/dungen/dungen.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) delete mode 100755 share/hackvr/examples/dungen/dungen (limited to 'share/hackvr/examples') diff --git a/share/hackvr/examples/dungen/dungen b/share/hackvr/examples/dungen/dungen deleted file mode 100755 index 1fc1c76..0000000 Binary files a/share/hackvr/examples/dungen/dungen and /dev/null differ diff --git a/share/hackvr/examples/dungen/dungen.c b/share/hackvr/examples/dungen/dungen.c index 0ea4906..10f92d3 100644 --- a/share/hackvr/examples/dungen/dungen.c +++ b/share/hackvr/examples/dungen/dungen.c @@ -1,4 +1,8 @@ #include +#include +#include +#include +#include #define ITERATIONS 16 @@ -52,8 +56,12 @@ void grow() { int main(int argc,char *argv[]) { int i; + int seed=time(0) * getpid(); + if(argc > 1) { + seed=atoi(argv[1]); + } printf("\x1b[H\x1b[2J"); - srandom(time(0) * getpid()); + srandom(seed); a[0x0]=" "; a[0x1]="- "; a[0x2]=" -"; @@ -74,9 +82,10 @@ int main(int argc,char *argv[]) { field[7+16] = 0x4;//center top for(i=0;i