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).