0

I've finished working on my pset3 game of fifteen. After consulting Check50, it keeps telling me that: timed out while waiting for "Illegal move." Can someone explain this to me? Don't know what to do. Here's the Check50's output.

:) fifteen.c exists.
:) fifteen.c compiles.
:) 3x3 board: init initializes board correctly
:( 3x3 board: catches moving 8 an illegal move
    timed out while waiting for "Illegal move."
:) 3x3 board: catches moving 1 as a legal move
:) 3x3 board: move blank up twice
:) 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
:( 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
    timed out while waiting for "Illegal move."
:( 3x3 board: make sure game is winnable
    timed out while waiting for program to exit
:( 4x4 board: make sure game is winnable
    timed out while waiting for program to exit

Here's the link to my code: https://pastebin.com/9redrKh2

  • the link is broken – obesman Jul 31 '17 at 19:13
  • These problems appear when there is an infinite loop, but the link does not work – MARS Jul 31 '17 at 20:14
  • Oh, sorry about that. Here's the new link please: pastebin.com/9redrKh2 – Hubert Aug 2 '17 at 19:03
0

Did you solve this yet? To debug my won() function, I disabled the clear() function and added eprintf lines to the inner loop. Use printf or eprintf to show what the i, j and current board[i][j] values are.

| improve this answer | |
0

I understand the latest update was supposed to have resolved this issue by making the 2 interchangeable, but even after running update50 on my end I find the problem still persists. In your move() function, try using GetInt() instead of get_int().

| improve this answer | |

You must log in to answer this question.

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