Skip to main content
2 votes

Pset3- game of fifteen. My code runs perfectly. but check50 says....expected file to be of length 18, not 0

Sounds like you lost the logging section of the supplied code. It was in the distro fifteen.c at line 80 after the call to draw(): // log the current state of the board (for testing) for (int i = ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Pset3 move problem

Use like if (y > 0 && j[y-1][x] == 0) and if (y < d-1 && j[y+1][x] == 0) (equivalent checks for x on the other lines) to prevent this from being evaluated for invalid coordinates....
Blauelf's user avatar
  • 21k
1 vote

pset3 fifteen check50 error

It is not complaining about the compile, that gives a :). It is complaining that the board is not initialized correctly. Remember from the check50 section of the spec: Note that check50 assumes ...
DinoCoderSaurus's user avatar
1 vote
Accepted

"Expected Expression" Error on Move Function

These are all syntax errors. In the case of the first two, it's an incorrect initialization, more or less. I'll explain. in order to use the {...} technique, you have to do this at the same time as ...
Cliff B's user avatar
  • 69k
1 vote

CS50 > Pset3 > Game of fifteen > init function :

If they are not swapped, the puzzle is not solvable. You can review the Wikipedia article about the game to learn about the arcane mathematics "happening behind the screen".
DinoCoderSaurus's user avatar
1 vote

working with game of fifteen

The error states that if non of your for loops are executed then function is not able to return any value to the function call. Reaching the end of a non void function without returning a value is ...
Airesh Bhat's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible