-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Our CS50 AP course still uses the 2019 Fifteen pset. The provided check50 slug check50 cs50/problems/2019/ap/fifteen does not check for a correct implementation of won(). The following code passes check50 and submit50, even though board[d-1][d-1] is supposed to be a 0:
bool won(void) {
int counter = 0;
for (int i = 0; i < d; i++) {
for (int j = 0; j < d; j++) {
if (board[i][j] == counter) {
counter++;
}
else return false;
}
}
return true;
}
In fact, changing the implementation of won() to just return true; or return false; also passes check50 so it doesn't seem to be checking won() at all. Can this be fixed?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels