Puzzle Updating: Final Version
/* Update puz according to each move. */
/* Offsets to new position of blank on move m are delatR[m] and deltaC[m]. */
int [] deltaR = {0, -1, 1, 0, 0};
int [] deltaC = {0, 0, 0, -1, 1};
/* rowB,colB is position of blank, initially the lower-right hand corner.
// Blank moves to rowNew, colNew.
int rowNew = rowB + deltaR[m];
int colNew = colB + deltaC[m];
puz[rowB][colB] = puz[rowNew][colNew];