Update cave.cpp

master
TechDudie 2021-04-15 14:10:27 -05:00 committed by GitHub
parent e4310d657d
commit bc032b6273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -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);
}
}
}
}