diff --git a/cave.cpp b/cave.cpp index 0c44d3e..15ae3b0 100644 --- a/cave.cpp +++ b/cave.cpp @@ -3,15 +3,21 @@ #include using namespace std; static int SEED = 65536; //test seed +void air(x,y,z) { + //TODO +} int sphere(x,y,z,r) { int xx = 0, yy = 0, zz = 0; - int pos[3] = [x,y,z] + int pos[3] = [x,y,z]; + int length for (xx = 0 - r; xx < r + 1; xx++) { for (yy = 0 - r; yy < r + 1; yy++) { for (zz = 0 - r; zz < r + 1; zz++) { - pos[0] = x + xx; - pos[1] = y + yy; - pos[2] = z + zz; + pos[0] = x + xx; pos[1] = y + yy; pos[2] = z + zz; + length = sqrt(pow(pos[0],2) + pow(pos[1],2) + pow(pos[2],2)); + if (length < r) { + air(x,z,y); + } } } }