How about this, any javascript programmers over here?
JavaScript:
var \_aUpBlocks = new Array(); var \_aLeftBlocks = new Array(); var \_aRightBlocks = new Array(); \_aUpBlocks[0] = [];\_aLeftBlocks[0] = [];\_aRightBlocks[0] = []; \_aUpBlocks[1] = [];\_aLeftBlocks[1] = [0];\_aRightBlocks[1] = [2];
First off, you should probably index your arrays with 1, as that’s how Lua does it. That means all your array indices will be incremented by one. So _aUpBlocks[1] -> _aUpBlocks[2], etc.
Second, you’re setting _aLeftBlocks[1] to the number 0, rather than an array with the number 0 inside it. Same goes for _aRightBlocks[1].
\_aLeftBlocks[1] = {0}
And the semicolons are completely unneeded in Lua. Lua doesn’t have semicolon troubles.
Technically, yes. But, like I said, JavaScript uses 0 as the first element in an array, while Lua uses 1. A “semantic” translation would change the 0s to 1s and the 1s to 2s etc.
How about this, any javascript programmers over here?
JavaScript:
var \_aUpBlocks = new Array(); var \_aLeftBlocks = new Array(); var \_aRightBlocks = new Array(); \_aUpBlocks[0] = [];\_aLeftBlocks[0] = [];\_aRightBlocks[0] = []; \_aUpBlocks[1] = [];\_aLeftBlocks[1] = [0];\_aRightBlocks[1] = [2];
First off, you should probably index your arrays with 1, as that’s how Lua does it. That means all your array indices will be incremented by one. So _aUpBlocks[1] -> _aUpBlocks[2], etc.
Second, you’re setting _aLeftBlocks[1] to the number 0, rather than an array with the number 0 inside it. Same goes for _aRightBlocks[1].
\_aLeftBlocks[1] = {0}
And the semicolons are completely unneeded in Lua. Lua doesn’t have semicolon troubles.
Technically, yes. But, like I said, JavaScript uses 0 as the first element in an array, while Lua uses 1. A “semantic” translation would change the 0s to 1s and the 1s to 2s etc.