This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I would use arraycopy() looping through rows, that is, copying row by row.
This code will copy all rows from board (0 - 7) into rows (1 - 8) of newboard. For each row, it copies 8 positions from board starting at 0, to newboard starting at 1. You would have to initialize the new cells accordingly...
Edit: I screwed up a little bit on the array declarations, nevermind, look at Ernest's code I rarely use jagged arrays! Edit II: Just to point out that this code copies the original board centered on the new one, yielding new cells all around. Ernest's version adds rows and columns at the end.
[ October 05, 2007: Message edited by: greg buela ] [ October 05, 2007: Message edited by: greg buela ]
Joined: Aug 10, 2007
Thanks for your quick responses!
It's good to know that I was on the right track (conceptually speaking).