hi, i need algorithm to read the elements of an 8 x 8 matrix in a zigzag way. and also want the antizigzag algorithm to recover the elements.

i am giving link below..... that will show how actually i want to read the elemnts of the matrix.

http://www.ascc.net/nl/84/1110/05.html

there is a figure which shows the zigzag scan.

can you suggest any algorithm how to read and recover (anti zigzag) the elements in that way???

thanks