I am trying to make a tetris game. I am trying to work on a function that rotates a 2D variable array 90 degrees (or -90).
For example, given an array like:
"-T-",
"TTT"
I would like an output like:
"T-",
"TT",
"T-"
etc, etc.
I have tried this function:
function rotateN90(a){
var temp = [];
for(var x = 0; x<a[0].length; x++){
temp.push("");
for(var y = 0; y<a.length; y++){
temp[x] += a[y][x];
}
}
return temp;
}
but it does not give the desired result. While it does rotate the first T-Block example given -90 degrees once, afterwards it reverts to it’s original state.
Please help!
(PS: I am using KA’s processing environment, so I can’t use libraries)
medicine lasix 20 mg – order lasix 40 mg furosemide 20 mg tablet brand name
where do i get viagra – online viagra from india buy 1 viagra pill
viagra 100 mg tablet price – how to purchase viagra in india viagra tablets india
vardenafil on line – vardenafil online pharmacy vardenafil cheap
ivermectin 3 mg dose – ivermectin cream 5%
doxycycline without rx – doxycycline 50 mg buy prednisolone 5mg tabs
buy prednisone 20mg – prednisone corticosteroids prednisone 20 mg tablet
prednisone 20 mg buy online – prednisone 10mg medication order prednisone 20mg
buy ivermectin canada – ed solutions ivermectin 12mg
where to buy tadalafil on line tadalafil goodrx
tadalafil generic where to buy where to buy tadalafil on line
buy tadalafil https://cialisicp.com/
https://cialisvet.com/ tadalafil generic
what is tadalafil cost tadalafil generic
buy ivermectin 6mg ivermectin online ivermectin from india
stromectol 0.5 mg buy 6 mg stromectol