0

In the game of fifteen, I couldn't figure out a way to view the under-score sign "_" , I tried these lines of code: if (board[i][j] == 0) //checking if value is 0 to print a blank tile.

               printf(" _ ");

but still, 0 appears! any help would be appreciated???

0

It depends on where that code is. It should work IF it is inside the i,j loops AND program has not already printed 0. Does the prompt show the _, like this _ Tile to move:? That would indicate the right code is in the wrong place.

| improve this answer | |
  • yes, it's inside the i,j loop.. and no, it doesn't show it. this is the loop: for (i=0; i<d;i++){ for (j=0; j<d;j++){ if (board[i][j] == 0) printf(" _ "); else printf("%d\t",board[i][j]); } printf("\n"); } – Raw Jul 7 '17 at 5:15
  • All things being equal, that code will print _ when board[i][j] is 0; something else is going on. You'd need to post the code for further analysis. – DinoCoderSaurus Jul 7 '17 at 11:01
  • I'll post it in another question, because it's pretty long – Raw Jul 8 '17 at 1:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .