diff options
| author | Franklin Wei <me@fwei.tk> | 2018-11-12 12:18:25 -0500 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2018-11-12 12:18:25 -0500 |
| commit | ea945ff4ffae82bb1ee77ec28ce373ba4525d283 (patch) | |
| tree | 4566e1840d277cbfb93ae0dc1f3d87c68e51f28e /genrand.c | |
| parent | d0c2beb062bb267d35c5d2c800ae448f33b65868 (diff) | |
| download | circgraph-ea945ff4ffae82bb1ee77ec28ce373ba4525d283.zip circgraph-ea945ff4ffae82bb1ee77ec28ce373ba4525d283.tar.gz circgraph-ea945ff4ffae82bb1ee77ec28ce373ba4525d283.tar.bz2 circgraph-ea945ff4ffae82bb1ee77ec28ce373ba4525d283.tar.xz | |
Change graph description format
Also adds a `genrand' program for testing purposes.
Diffstat (limited to 'genrand.c')
| -rw-r--r-- | genrand.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/genrand.c b/genrand.c new file mode 100644 index 0000000..47362eb --- /dev/null +++ b/genrand.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include <math.h> + +int main(int argc, char *argv[]) +{ + if(argc != 2) + { + fprintf(stderr, "Usage: %s EDGES\n", argv[0]); + return 1; + } + + int edges = atoi(argv[1]); + + srand(time(0)); + + printf("a b\n"); + for(int i = 0; i < edges; i++) + printf("%c %c 1\n", 'a' + rand() % 26, 'a' + rand() % 26); +} |