}
/* random position */
- pos = (pos > 0) ? rand () % pos : 0;
+ if (pos > 0) {
+ pos = rand () % pos;
+ }
for (j = 0; (j < board->length) && (pos >= 0); j++) {
if (getvalue (box, j % n, j / n) == ' ') {
if (pos == 0) {
}
}
- char *buffer = (char *) calloc (board->length * (8 + board->length) + 1, 1);
- _makecomments (buffer, box);
- printf ("box:\n%s", buffer);
- _makecomments (buffer, board);
- printf ("board:\n%s", buffer);
- free (buffer);
+ char *buffer = (char *) calloc (board->length * (8 + board->length) + 1, 1);
+ _makecomments (buffer, box);
+ printf ("box:\n%s", buffer);
+ _makecomments (buffer, board);
+ printf ("board:\n%s", buffer);
+ free (buffer);
freeboard (box);
}