0

I can not fix the won function. Itso almost complete but the 4x4 is not winnable... enter image description here

enter image description here

please help!

0

If 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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .