Commit a3645d23 authored by rforder's avatar rforder

Adjusting output again

parent acfb96e6
......@@ -170,8 +170,14 @@ int test_seq_length_k(domino *domino_list, int k, char *input)
for (x = 0; x < k; x++)
{
domino *d = get_ith_domino(seq[x], domino_list);
printf("%s %s", d->a, d->b);
if (x != k - 1) printf(", ");
if (input)
{
printf("%s %s", d->a, d->b);
if (x < k - 1)
printf(", ");
}
else
printf("%s", d->a);
}
printf("\n");
if (input)
......@@ -230,7 +236,7 @@ int main(int argc, char **argv)
int k = 1;
int accepted = 0;
while (k < (argc == 3 ? strlen(argv[2]) : 999))
while (k != (argc == 3 ? strlen(argv[2]) : -1))
{
if (test_seq_length_k(domino_list, k, (argc == 3 ? argv[2] : NULL)))
{
......@@ -242,14 +248,6 @@ int main(int argc, char **argv)
}
k++;
}
if (accepted)
{
printf("accepted\n");
}
else
{
printf("rejected\n");
}
domino *d = domino_list;
domino *e;
while (d)
......
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment