1

Can someone tell me how is check50 testing fifteen.c? My code is failing (see error below) the test, but if I try to do the steps that are failing, I see nothing wrong.

3x3 board, from start try to move tile 2, 4, 5, 6, 7, 8

Those are all invalid moves and at the end, my board is in the same position as it started.

Am I misunderstanding the output of the test?

/home/ubuntu/workspace/pset3/fifteen/ $ check50 2015.fall.pset3.fifteen fifteen.c 
:) 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
   \ expected "4" character 3 of line 17, not "0"
:) 3x3 board, from start try to move tile 2, 4, 5, 6, 7, 8
:) 3x3 board, move blank left (tile 1) then up (tile 4), then try to move tiles 1, 2, 6, 8
:) 3x3 board, move blank up (tile 3), then try tile 2
:| 3x3.txt wins the 3x3 board
   \ can't check until a frown turns upside down
:| 4x4.txt wins the 4x4 board
   \ can't check until a frown turns upside down
https://sandbox.cs50.net/checks/7855d0658ecb47f4be4cf599391e57ee

Thanks.

0

That's the next test, and it passed. If you look one test earlier, that's the one that's failing.

:( 3x3 board, move up-up-left-down-down-left-up-up-right-down-down-right
\ expected "4" character 3 of line 17, not "0"

This refers to the output to the log.txt file. It means that the test fails after the following moves: 3 6 7 4. Without seeing the code, there's no way to figure out why.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

  • Duh! of course it is. I reproduced the problem and quickly fixed my code. Thanks for the gentle dope slap. – Alexis Aug 3 '16 at 23:53

You must log in to answer this question.

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