i got an 8×8 Array and want to convert it into an 1d array with 64 fields.
But in this special zig zag order:

I want the smart way but i don’t have a clue. I got two possible theories but they are not smart. Any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have an array with 64 entries that holds the indexes in the order that the zig-zag pattern would visit them. You’d probably use them as offsets from some buffer. This is for JPEG stuff right?