Created
July 15, 2015 14:16
-
-
Save xphong/05954bd2f8e3d26ac7ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: Add comments | |
var GRID_BASE = 8, | |
ySize = parseInt(scope.ysize), | |
xSize = parseInt(scope.xsize), | |
startPosition = parseInt(scope.startposition), | |
quadrantArea = [], | |
yStartPosition = Math.floor(startPosition / GRID_BASE), | |
xStartPosition = startPosition % GRID_BASE; | |
for (i = 0; i < ySize; i++) { | |
for (j = 0; j < xSize; j++) { | |
gridArea.push(GRID_BASE * (yStartPosition + i) + (xStartPosition + j)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment