I've been having some trouble with the fifteen game code. Even though it works as expected, when I do check50, I get a bunch of errors related to the expected size of the log file.

After looking at the Sandbox: https://sandbox.cs50.net/checks/a279302253d34014a267235e98376d0d

I found that my log file had blank spaces between each move. This looked different from the expected log (as well as some weird lines and a dot... but well)

The fact that the error is being caused by the blank spaces seems really strange to me, since I'm not really dealing with the log file code. So, I decided to change the code a little bit, just to remove that extra empty space.

Tadah! It worked, and check50 is no longer showing me any errors.

But... I'm not sure if I'm really allowed to do this, if this is just a cheap solution to the problem. I believe its fine, since the actual log my code is generating looks perfectly fine, and it makes sense to remove this empty space if it is not in the expected log file... so yeah, this is my question:

Am I allowed to do this?? thanks.

  • I have a problem with my log.txt file as well. My program seems to work fine and I have tested it with ./fifteen 3 < ~cs50/pset3/3x3.txt and it goes all the way through and solves the game. However my log.txt file always shows the bottom 2 rows of a 3x3 as zero. Any ideas?
    – MSevey
    Feb 21 '17 at 17:06
  • I don't think you should really need to change the code that the cs50 folks distributed. Is it possible that at some point you accidentally made a change in there code when you intended to change some other lines without realizing it? Maybe get a fresh copy of the distribution code and see how it compares to the stuff you had to change.
    – ItsAnApe
    Apr 15 '17 at 10:53

You must log in to answer this question.

Browse other questions tagged .