Update cave.cpp
parent
e4310d657d
commit
bc032b6273
14
cave.cpp
14
cave.cpp
|
@ -3,15 +3,21 @@
|
|||
#include <iostream>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue