I can not fix the won function. Itso almost complete but the 4x4 is not winnable...
please help!
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.
Sign up to join this communityIf your won
works for a 3x3, then it will work for a 4x4.
So that means your issue is probably in the init
function. When you play the game ./fifteen 4
do you see this at the beginning of log.txt:
15|14|13|12
11|10|9|8
7|6|5|4
3|1|2|0
in other words, did you remember to swap the 1 & 2 tiles in your init?