0

I am working on the game of fifteen on problem set 3. The code runs fine but fails check50. the error message is as follows:

:) fifteen.c exists

:) fifteen.c compiles

:) init initializes 3x3 board correctly

:) init initializes 4x4 board correctly

:) 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, from start try to move tile 2, 4, 5, 6, 7, 8 \ expected "6" character 5 of line 17, not "0":( 3x3 board, move blank left (tile 1) then up (tile 4), then try to move tiles 1, 2, 6, 8 \ expected "1" character 5 of line 15, not "0":) 3x3 board, move blank up (tile 3), then try tile 2

:) 3x3.txt wins the 3x3 board

:) 4x4.txt wins the 4x4 board

I cant understand why the error message appears!

1 Answer 1

1

Try generating a 3x3 board and make the same moves check50 did, you should be able to spot the error.
If this answers your question please mark as answered.

1
  • Did a step by step run. There was an error in one of my condition in move function. Thank you :)
    – Hydes
    Aug 31, 2016 at 9:31

You must log in to answer this question.

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