This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Let's look at the algorithm:
1) start at 1,1 (x == 1, y == 1)
2) move right once (x++)
3) move to the bottom left (x--, y++) until you've reached the left or bottom side
4) move to the bottom (y++)
5) move to the top right (x++, y--) until you've reached the right or top side
6) go to step 2 until you've reached the last cell
A simple loop would now do the trick. Keep in mind that Java arrays start at 0, not 1, so my values for x and y in step 1 are wrong.