Hot answers tagged

5

Your program is doing a good job (although not perfect) of detecting the blocks with the signature, creating the files and writing out the first block of each file. However, you have done nothing to process the subsequent blocks in each image file, which will NOT have the signature. In other words, you detect a signature block, create a file and write out ...


1

Would have been great had you stated The problem (preferably with a link to the problem statement) How you tried to invoke check50 The link to the result as text, not a screenshot, or a sanitized screenshot of the result (hint: The page contains your GitHub username :-P) I assume you are using the wrong slug, guessing you are taking CS50x in 2019. You used ...


1

If i is row and j is column (as evidenced by board[i][j]), then your "directional" variables are slightly off. left (previous column) would be at board position board[i][j-1]; down (next row) at board position board[i+1][j]; &tc. You get the idea.


1

You have a serious problem with your tests. For example, look at the following: if(board[blank_x][blank_y] == board[m+1][n] && 0 <= m <= d-2 && 0 <= n <= d-1) More specifically, look at the parts. Let's take one portion to be absolutely clear what's wrong: 0 <= m <= d-2 In high school math (or earlier?) we were taught ...


1

Your code looks for a signature at the beginning of a block. Since it appears to be creating a number of files, that part seems to be working, sort of. Creating 24 files? Hmmm, that's a problem. If no file is open, it will open a file. If it finds a signature and an output file is open, it closes it and moves on to the next block. So, it looks to me that ...


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