Skip to content

Commit

Permalink
Add blank tiles to the Truchet tile plot. Not sure if I like it. Mayb…
Browse files Browse the repository at this point in the history
…e make them optional via a command-line argument.
  • Loading branch information
anachrocomputer committed Sep 19, 2020
1 parent eaa25fc commit 7b60ce9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions truchet2.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ int main(int argc, char * const argv[])
double height;
double gridw, gridh;
double gridx0;
static struct Tile connect[6] = {
static struct Tile connect[7] = {
{false, true, true, false}, // 0
{false, true, false, true}, // 1
{true, false, true, false}, // 2
{true, false, false, true}, // 3
{true, true, false, false}, // 4
{false, false, true, true} // 5
{false, false, true, true}, // 5
{false, false, false, false} // 6
};

while ((opt = getopt(argc, argv, "no:p:s:t:v:")) != -1) {
Expand Down Expand Up @@ -102,7 +103,7 @@ int main(int argc, char * const argv[])
for (i = 0; i < ngridy; i++) {
for (j = 0; j < ngridx; j++) {
// tile_type = (i + j) % 6;
tile_type = rand() / (RAND_MAX / 6);
tile_type = rand() / (RAND_MAX / 7);
grid[i][j] = tile_type;
}
}
Expand Down

0 comments on commit 7b60ce9

Please sign in to comment.