Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Split a grid into diagonals, the other way?

Author
Message
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 17th Dec 2016 14:28
I have a grid and I'm trying to split it into sub arrays along diagonals, basically if I have this grid
A, B
C, D
E, F

I want arrays [A], [C, B], [E, D], [F]. And with this code, I think I pretty much have that.


However! I also want it the other direction so to say, so I get the arrays [B], [A, D], [C, F], [E]. And I just can't figure it out, my attempts either causes me to not loop through the grid correctly or I get an out of bounds error.

Does anyone have a suggestion on how I can tweak my code so I get what I want?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Dec 2016 18:21
this way?
AGK (Steam) V2.0.22 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12)
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 18th Dec 2016 09:22
Thank you, I think that pointed me in the right direction.

Login to post a reply

Server time is: 2024-11-17 15:09:11
Your offset time is: 2024-11-17 15:09:11