Re: Need help with C++ code!!!!!
The best way to accomplish this is to first generate a 2D array (which would be 5x5 for your example). Then run a loop similar to the following:
set start position in array
for n = 25 to 1
set array element at position to n
if moved position is off the array (you hit an edge) or it already has a number
Could use a little refinement (the logic is kinda ugly), but should get the job done.
All the world's a computer, and all the men and women merely AI agents...