Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a 2-D array of different cha

Status
Not open for further replies.

crazy888s

Technical User
Jun 24, 2003
144
I have a 2-D array of different char values sorted in a logical square (there are the same amount of arrays as their are values in each array: [size][size] thisArray.) Each square has layers depending on how big it is. Ex (each number below represents a different layer):

22222
21112
21012
21112
22222

or:

1111
1001
1001
1111

etc.

How can I rotate, for example, layer 2 of the top square 4 units clockwise, or layer 0 of the bottom square, etc. (layers and rotation units are ints)? Any input is greatly appreciated! Thanks.
 
Can you show some sample output that you would
expect from the script?
It might help us understand what you are trying to
do.

2b||!2b
 
Nevermind. I figured it out! Thanks though.
 
crazy888s,

how did you solve it? after reading your post, i went and developed a LogicalSquare() class/object with getLayer(), setLayer() and rotateLayer() methods. not a simple project, but it lets you create a LogicalSquare of X layers, set the contents of any layer and rotate any layer by X units forward or back.



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top