diff options
| author | Franklin Wei <me@fwei.tk> | 2018-11-12 13:26:04 -0500 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2018-11-12 13:26:04 -0500 |
| commit | bb87e0d168d01ca4a02d6d438f165e6f20bebbf0 (patch) | |
| tree | ca7a66e1198aa77669a476eb7c1de901562c180d /genrand.c | |
| parent | ea945ff4ffae82bb1ee77ec28ce373ba4525d283 (diff) | |
| download | circgraph-bb87e0d168d01ca4a02d6d438f165e6f20bebbf0.zip circgraph-bb87e0d168d01ca4a02d6d438f165e6f20bebbf0.tar.gz circgraph-bb87e0d168d01ca4a02d6d438f165e6f20bebbf0.tar.bz2 circgraph-bb87e0d168d01ca4a02d6d438f165e6f20bebbf0.tar.xz | |
Update things
Need to refine termination condition. Apart from that, it's fairly robust.
Diffstat (limited to 'genrand.c')
| -rw-r--r-- | genrand.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -14,6 +14,15 @@ int main(int argc, char *argv[]) srand(time(0)); printf("a b\n"); + printf("a b 1\n"); for(int i = 0; i < edges; i++) - printf("%c %c 1\n", 'a' + rand() % 26, 'a' + rand() % 26); + { + char a, b; + a = rand() % 26; + do { + b = rand() % 26; + } while(b == a); + + printf("%c %c 1\n", 'a' + a, 'a' + b); + } } |