extends Node2D
var m=[]
var n=[]
func _ready():
m=[ [1,2,3],
[4,5,6],
[7,8,9] ]
n=[ [0,0,0],
[0,0,0],
[0,0,0] ]
print_matrix(m)
rotate_matriz()
print_matrix(m)
func rotate_matriz():
for i in m.size():
for j in m[i].size():
n[(m.size()-1)-j][i] = m[i][j]
m= n
func print_matrix(m):
for i in m.size():
print(m[i])
print("--------")
n[(m.size()-1)-j][i] = m[i][j]
This rotates the matrix 90 degrees to the left. Needs to be implemented the clockwise
rotation and how many times it is rotated.
Thank you
It works well
But I need time to understand