This file contains hidden or 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
| #include <iostream> | |
| using namespace std; | |
| #define SAFE_DELETE_ARRAY(ptr) { if(ptr) { delete [](ptr); (ptr)=NULL; } } | |
| int main(){ | |
| // alloc 'team' | |
| int*** team = new int**[1001]; | |
| for(int x = 0; x < 1001; x++){ |
This file contains hidden or 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
| #include <stdio.h> | |
| int max(int a, int b, int c){ | |
| int t = ( a > b ? a : b); | |
| return (t > c ? t : c); | |
| } | |
| int max(int a, int b){ | |
| return (a > b? a : b); |
This file contains hidden or 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
| -- https://github.com/davidm/lua-matrix/blob/master/lua/matrix.lua | |
| local matrix = require 'matrix' | |
| -- Origin x,y (Screen coord) | |
| Ix0, Iy0 = 93, 329; -- Isometric | |
| Dx0, Dy0 = 450, 329; -- Descartes | |
| -- invert y axis, move to Dx0, Dy0 | |
| descartesToScreenMatrix = (matrix{{1, 0, Dx0}, {0, 1, Dy0}, {0, 0, 1}} * matrix{{1, 0, 0}, {0, -1, 0}, {0, 0, 1}}) | |
| -- Basis Vector I is (sqrt(3)/2, -1/2), J is (0, 1) |
NewerOlder