0

When I run the command check50.... it reports several correct and some incorrect outputs. One of the examples:

:( 3x3 board: move blank up twice did not find "8-7-0|5-4-6|2-1..."

Log running ./fifteen 3... sending input 3... checking for output "8-7-6|5-4-0|2-1-3 "... sending input 6... checking for output "8-7-0|5-4-6|2-1-3 "...

I did these steps myself and the output was 8-7-0 ... ....

Here is the log: 8|7|6 5|4|3 2|1|0 3 8|7|6 5|4|0 2|1|3 6 8|7|0 5|4|6 2|1|3

Here is the report: https://cs50.me/checks/a9c9c6970406e12bdb924db3224dd45592eafc79

Here is the code: https://www.dropbox.com/s/ziq99jz7aj9f3bu/fifteen.c?dl=0

Thanks!

2

check50 removes your draw function as that is not tested (you can personalize it however you'd like).

Because of this, if you update any global variables in that function, they won't be updated when check50 runs the program. Your draw should only print the board.

You'll need to move your empty_i = i; and empty_j = j; lines to another function. (makes sense to do that in move).

| improve this answer | |

You must log in to answer this question.

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