My fifteen.c passes the following local tests by getting to "ftw!" in each case:
~/workspace/pset3/fifteen/ $ ./fifteen 3 < ~cs50/pset3/3x3.txt ~/workspace/pset3/fifteen/ $ ./fifteen 4 < ~cs50/pset3/4x4.txt
However check50 gives me some sad face timeouts:
~/workspace/pset3/fifteen/ $ check50 cs50/2017/x/fifteen Connecting......... Authenticating..... Preparing........... Uploading........... Running checks........... :) fifteen.c exists. :) fifteen.c compiles. :) 3x3 board: init initializes board correctly :) 3x3 board: catches moving 8 an illegal move :) 3x3 board: catches moving 1 as a legal move :( 3x3 board: move blank up twice timed out while waiting for "8-7-0|5-4-6|2-1..." :) 3x3 board: move blank left twice :) 3x3 board: move blank left then right :) 3x3 board: move blank up then down :( 3x3 board: move up-up-left-down-down-left-up-up-right-down-down-right timed out while waiting for "4-1-7|8-2-6|5-3..." :( 3x3 board: make sure none of 2, 4, 5, 6, 7, 8 move tile timed out while waiting for "Illegal move." :) 3x3 board: move blank left (tile 1) then up (tile 4), then try to move tiles 1, 2, 6, 8 :( 3x3 board: make sure game is winnable timed out while waiting for "1-2-3|4-5-6|7-8..." :( 4x4 board: make sure game is winnable timed out while waiting for "1-2-3-4|5-6-7-8..."
See https://cs50.me/checks/8d1291e5a0afa904e53647818bf44925f063b373 for more detail.
But, when I attempt the sad faces manually, the log file looks good to me, eg:
:( 3x3 board: move blank up twice timed out while waiting for "8-7-0|5-4-6|2-1..."
Here's the log file - it looks good to me:
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
... so I don't know why the computer is timing out when looking for "8-7-0|5-4-6|2-1..."
NB These timeouts are consistent. They are always in the same place no matter how many times I run check50. I have also tried reducing the usleep pauses to usleep(5000) - ie very small pauses, but it doesn't help.
I also tried editing the logging so the strings match exactly what the output says it's looking for, ie
8|7|0 5|4|6 2|1|3
But still it didn't help - I get the same errors.