Skip to main content
misread so edited reply
Source Link
curiouskiwi
  • 18.7k
  • 2
  • 18
  • 43

Without seeing your init code(new reply as I misread!)

You would expect when tile==3, I'd guess that you may have initialized your board as col/row instead ofx,y is 1,2 :

0,0 0,1 0,2
1,0 1,1 1,2
2,0 2,1 2,2

Remember, it's row/,col? If the blank was in a different spot it would probably also show as reversed so what you are seeing is correct.   

(but 2,2Your init is 2,2doing the right thing).

Without seeing your init code, I'd guess that you may have initialized your board as col/row instead of row/col? If the blank was in a different spot it would probably also show as reversed.  (but 2,2 is 2,2)

(new reply as I misread!)

You would expect when tile==3, that x,y is 1,2 :

0,0 0,1 0,2
1,0 1,1 1,2
2,0 2,1 2,2

Remember, it's row,col so what you are seeing is correct. 

(Your init is doing the right thing).

Source Link
curiouskiwi
  • 18.7k
  • 2
  • 18
  • 43

Without seeing your init code, I'd guess that you may have initialized your board as col/row instead of row/col? If the blank was in a different spot it would probably also show as reversed. (but 2,2 is 2,2)