#include <iostream> #include <string> #include "minecraft.h" using namespace std; TxMinecraft mc; /*绿色:35/13 黄绿色:35/5 红色:35/14 黑色:35/15*/ int main(int argc, char** argv) { bool con=mc.ConnectMinecraft("zk.makeblock.net.cn","4c4ce4431bdc409388e0a110f5aa9dcc"); if(!con){ return 0; cout<<"连接失败"; } bool fly=true; mc.setPlayerFly("hanxuyao",fly); string s[15][8][15]; int x,y,z; cin>>x>>y>>z; string id,data; string green="35,13",yellow="35,3",red="35,14",black="35,15"; //1 int y1=0; s[-1][y1][-2]=yellow; s[0][y1][-2]=yellow; s[1][y1][-2]=yellow; s[-2][y1][-1]=yellow; s[-1][y1][-1]=yellow; s[0][y1][-1]=yellow; s[1][y1][-1]=yellow; s[2][y1][-1]=yellow; s[-2][y1][0]=yellow; s[-1][y1][0]=yellow; s[0][y1][0]=yellow; s[1][y1][0]=yellow; s[2][y1][0]=yellow; s[-2][y1][1]=yellow; s[-1][y1][1]=yellow; s[0][y1][1]=yellow; s[1][y1][1]=yellow; s[2][y1][1]=yellow; s[-1][y1][2]=yellow; s[0][y1][2]=yellow; s[1][y1][2]=yellow; y1++; //2 s[-2][y1][-4]=yellow; s[-1][y1][-4]=yellow; s[1][y1][-4]=yellow; s[2][y1][-4]=yellow; s[-3][y1][-3]=yellow; s[3][y1][-3]=yellow; s[-2][y1][-3]=yellow; s[-1][y1][-3]=yellow; s[1][y1][-3]=yellow; s[2][y1][-3]=yellow; s[-3][y1][-2]=yellow; s[-2][y1][-2]=yellow; s[2][y1][-2]=yellow; s[3][y1][-2]=yellow; s[-4][y1][-1]=yellow; s[4][y1][-1]=yellow; s[-4][y1][0]=yellow; s[4][y1][0]=yellow; s[-3][y1][0]=yellow; s[3][y1][0]=yellow; s[-4][y1][1]=yellow; s[4][y1][1]=yellow; s[-3][y1][2]=yellow; s[-2][y1][2]=yellow; s[2][y1][2]=yellow; s[3][y1][2]=yellow; s[-3][y1][3]=yellow; s[3][y1][3]=yellow; s[-2][y1][3]=yellow; s[-1][y1][3]=yellow; s[1][y1][3]=yellow; s[2][y1][3]=yellow; s[-2][y1][4]=yellow; s[-1][y1][4]=yellow; s[1][y1][4]=yellow; s[2][y1][4]=yellow; s[0][y1][-4]=green; s[0][y1][-3]=green; s[-4][y1][-2]=green; s[4][y1][-2]=green; s[-3][y1][-1]=green; s[3][y1][-1]=green; s[-3][y1][1]=green; s[3][y1][1]=green; s[-4][y1][2]=green; s[4][y1][2]=green; s[0][y1][4]=green; s[0][y1][3]=green; y1++; //3 s[-2][y1][-5]=yellow; s[1][y1][-5]=yellow; s[2][y1][-5]=yellow; s[3][y1][-4]=yellow; s[-3][y1][-4]=yellow; s[4][y1][-3]=yellow; s[-4][y1][-3]=yellow; s[5][y1][-1]=yellow; s[-5][y1][-1]=yellow; s[5][y1][0]=yellow; s[-5][y1][0]=yellow; s[5][y1][1]=yellow; s[-5][y1][1]=yellow; s[-2][y1][5]=yellow; s[1][y1][5]=yellow; s[2][y1][5]=yellow; s[3][y1][4]=yellow; s[-3][y1][4]=yellow; s[4][y1][3]=yellow; s[-4][y1][3]=yellow; s[-1][y1][-5]=green; s[0][y1][-5]=green; s[-5][y1][-2]=green; s[5][y1][-2]=green; s[-5][y1][2]=green; s[5][y1][2]=green; s[1][y1][5]=green; s[0][y1][5]=green; y1++; //4 s[1][y1][-6]=green; s[0][y1][-6]=green; s[-5][y1][-3]=green; s[5][y1][-3]=green; s[-6][y1][-2]=green; s[6][y1][-2]=green; s[-1][y1][6]=green; s[0][y1][6]=green; s[-5][y1][3]=green; s[5][y1][3]=green; s[-6][y1][2]=green; s[6][y1][2]=green; s[-2][y1][-6]=yellow; s[-1][y1][-6]=yellow; s[2][y1][-6]=yellow; s[-3][y1][-5]=yellow; s[3][y1][-5]=yellow; s[-4][y1][-4]=yellow; s[4][y1][-4]=yellow; s[-6][y1][-1]=yellow; s[6][y1][-1]=yellow; s[-6][y1][0]=yellow; s[6][y1][0]=yellow; s[-6][y1][1]=yellow; s[6][y1][1]=yellow; s[-3][y1][5]=yellow; s[3][y1][5]=yellow; s[-4][y1][4]=yellow; s[4][y1][4]=yellow; s[-2][y1][6]=yellow; s[1][y1][6]=yellow; s[2][y1][6]=yellow; y1++; //5 s[-3][y1][-6]=yellow; s[-2][y1][-6]=yellow; s[3][y1][-6]=yellow; s[2][y1][-6]=yellow; s[1][y1][-6]=yellow; s[-4][y1][-5]=yellow; s[4][y1][-5]=yellow; s[-5][y1][-4]=yellow; s[5][y1][-4]=yellow; s[-6][y1][-2]=yellow; s[6][y1][-2]=yellow; s[-6][y1][-1]=yellow; s[6][y1][-1]=yellow; s[-6][y1][0]=yellow; s[6][y1][0]=yellow; s[-6][y1][2]=yellow; s[6][y1][2]=yellow; s[-6][y1][1]=yellow; s[6][y1][1]=yellow; s[-3][y1][6]=yellow; s[-2][y1][6]=yellow; s[3][y1][6]=yellow; s[2][y1][6]=yellow; s[1][y1][6]=yellow; s[-4][y1][5]=yellow; s[4][y1][5]=yellow; s[-5][y1][4]=yellow; s[5][y1][4]=yellow; s[-1][y1][-6]=green; s[0][y1][-6]=green; s[-6][y1][-3]=green; s[6][y1][-3]=green; s[-6][y1][3]=green; s[6][y1][3]=green; s[1][y1][6]=green; s[0][y1][6]=green; y1++; //6 s[0][y1][-7]=green; s[-1][y1][-7]=green; s[6][y1][-3]=green; s[-6][y1][-3]=green; s[0][y1][-7]=green; s[1][y1][-7]=green; s[6][y1][3]=green; s[-6][y1][3]=green; s[-1][y1][-7]=yellow; s[-4][y1][-6]=yellow; s[-3][y1][-6]=yellow; s[-2][y1][-6]=yellow; s[4][y1][-6]=yellow; s[3][y1][-6]=yellow; s[2][y1][-6]=yellow; s[-5][y1][-5]=yellow; s[5][y1][-5]=yellow; s[-6][y1][-4]=yellow; s[6][y1][-4]=yellow; s[-6][y1][-2]=yellow; s[6][y1][-2]=yellow; s[-7][y1][-1]=yellow; s[7][y1][-1]=yellow; s[-7][y1][0]=yellow; s[7][y1][0]=yellow; s[-7][y1][1]=yellow; s[7][y1][1]=yellow; s[-6][y1][2]=yellow; s[6][y1][2]=yellow; s[-6][y1][4]=yellow; s[6][y1][4]=yellow; s[-5][y1][5]=yellow; s[5][y1][5]=yellow; s[-1][y1][7]=yellow; s[-4][y1][6]=yellow; s[-3][y1][6]=yellow; s[-2][y1][6]=yellow; s[4][y1][6]=yellow; s[3][y1][6]=yellow; s[2][y1][6]=yellow; y1++; //7 s[1][y1][-7]=yellow; s[2][y1][-7]=yellow; s[-2][y1][-7]=yellow; s[-3][y1][-6]=yellow; s[-4][y1][-6]=yellow; s[3][y1][-6]=yellow; s[4][y1][-6]=yellow; s[-5][y1][-5]=yellow; s[5][y1][-5]=yellow; s[-6][y1][-4]=yellow; s[7][y1][-2]=yellow; s[7][y1][-1]=yellow; s[-7][y1][-1]=yellow; s[7][y1][0]=yellow; s[-7][y1][0]=yellow; s[7][y1][1]=yellow; s[-7][y1][1]=yellow; s[6][y1][4]=yellow; s[-1][y1][7]=yellow; s[-2][y1][7]=yellow; s[2][y1][7]=yellow; s[-3][y1][6]=yellow; s[-4][y1][6]=yellow; s[3][y1][6]=yellow; s[4][y1][6]=yellow; s[-5][y1][5]=yellow; s[5][y1][5]=yellow; s[-1][y1][-7]=green; s[0][y1][-7]=green; s[6][y1][-4]=green; s[6][y1][-3]=green; s[-6][y1][-3]=green; s[-2][y1][-7]=green; s[2][y1][7]=green; s[1][y1][7]=green; s[0][y1][7]=green; s[-6][y1][4]=green; s[6][y1][3]=green; s[-6][y1][3]=green; s[-2][y1][-6]=red; s[-1][y1][-6]=red; s[0][y1][-6]=red; s[2][y1][-6]=red; s[1][y1][-6]=red; s[-2][y1][-5]=red; s[-1][y1][-5]=red; s[0][y1][-5]=red; s[2][y1][-5]=red; s[1][y1][-5]=red; s[-4][y1][-5]=red; s[-3][y1][-5]=red; s[3][y1][-5]=red; s[4][y1][-5]=red; s[-2][y1][-4]=red; s[-1][y1][-4]=red; s[0][y1][-4]=red; s[2][y1][-4]=red; s[1][y1][-4]=red; s[-4][y1][-4]=red; s[-3][y1][-4]=black; s[3][y1][-4]=red; s[4][y1][-4]=red; s[5][y1][-4]=red; s[-5][y1][-4]=red; s[-2][y1][-3]=red; s[-1][y1][-3]=red; s[0][y1][-3]=red; s[2][y1][-3]=red; s[1][y1][-3]=black; s[-4][y1][-3]=red; s[-3][y1][-3]=red; s[3][y1][-3]=red; s[5][y1][-3]=red; s[-5][y1][-3]=red; s[-2][y1][-2]=red; s[-1][y1][-2]=red; s[0][y1][-2]=red; s[2][y1][-2]=red; s[1][y1][-2]=red; s[-4][y1][-2]=red; s[-3][y1][-2]=red; s[3][y1][-2]=red; s[5][y1][-2]=red; s[-5][y1][-2]=black; s[6][y1][-2]=red; s[-6][y1][-2]=red; s[-2][y1][-1]=red; s[-1][y1][-1]=red; s[0][y1][-1]=red; s[2][y1][-1]=red; s[1][y1][-1]=red; s[-4][y1][-1]=red; s[-3][y1][-1]=red; s[3][y1][-1]=red; s[5][y1][-1]=red; s[-5][y1][-1]=red; s[6][y1][-1]=red; s[-6][y1][-1]=red; s[-2][y1][0]=black; s[-1][y1][0]=red; s[0][y1][0]=red; s[2][y1][0]=red; s[1][y1][0]=red; s[-4][y1][0]=red; s[-3][y1][0]=red; s[3][y1][0]=red; s[4][y1][0]=red; s[5][y1][0]=red; s[-5][y1][0]=red; s[6][y1][0]=red; s[-6][y1][0]=red; s[-2][y1][1]=red; s[-1][y1][1]=red; s[0][y1][1]=red; s[2][y1][1]=red; s[1][y1][1]=red; s[-4][y1][1]=red; s[-3][y1][1]=red; s[3][y1][1]=red; s[4][y1][1]=red; s[5][y1][1]=red; s[-5][y1][1]=red; s[6][y1][1]=red; s[-6][y1][1]=red; s[-2][y1][2]=red; s[-1][y1][2]=red; s[0][y1][2]=red; s[2][y1][2]=red; s[1][y1][2]=red; s[-4][y1][2]=black; s[-3][y1][2]=red; s[3][y1][2]=red; s[4][y1][2]=black; s[5][y1][2]=red; s[-5][y1][2]=red; s[6][y1][2]=red; s[-6][y1][2]=red; s[-2][y1][3]=red; s[-1][y1][3]=red; s[0][y1][3]=red; s[2][y1][3]=red; s[1][y1][3]=red; s[-4][y1][3]=red; s[-3][y1][3]=red; s[3][y1][3]=red; s[4][y1][3]=red; s[5][y1][3]=red; s[-5][y1][3]=red; s[-2][y1][4]=red; s[-1][y1][4]=red; s[0][y1][4]=red; s[2][y1][4]=black; s[1][y1][4]=red; s[-4][y1][4]=red; s[-3][y1][4]=red; s[3][y1][4]=red; s[4][y1][4]=red; s[5][y1][4]=red; s[-5][y1][4]=red; s[-2][y1][5]=red; s[-1][y1][5]=black; s[0][y1][5]=red; s[2][y1][5]=red; s[1][y1][5]=red; s[-4][y1][5]=red; s[-3][y1][5]=red; s[3][y1][5]=red; s[4][y1][5]=red; s[-2][y1][6]=red; s[-1][y1][6]=red; s[0][y1][6]=red; s[2][y1][6]=red; s[1][y1][6]=red; y1++; //8 s[-2][y1][-7]=yellow; s[2][y1][-7]=yellow; s[-3][y1][-6]=yellow; s[4][y1][-6]=yellow; s[-4][y1][-6]=yellow; s[3][y1][-6]=yellow; s[-5][y1][-5]=yellow; s[5][y1][5]=yellow; s[-7][y1][-1]=yellow; s[7][y1][-1]=yellow; s[-7][y1][0]=yellow; s[7][y1][0]=yellow; s[-7][y1][1]=yellow; s[7][y1][1]=yellow; s[-2][y1][7]=yellow; s[2][y1][7]=yellow; s[-3][y1][6]=yellow; s[4][y1][6]=yellow; s[-4][y1][6]=yellow; s[3][y1][6]=yellow; s[-5][y1][5]=yellow; s[5][y1][5]=yellow; s[0][y1][-7]=yellow; s[1][y1][-7]=yellow; s[-1][y1][-7]=yellow; s[-6][y1][-3]=yellow; s[6][y1][-3]=yellow; s[-6][y1][-4]=yellow; s[6][y1][-4]=yellow; s[-7][y1][-2]=yellow; s[7][y1][-2]=yellow; s[-7][y1][2]=yellow; s[7][y1][2]=yellow; s[0][y1][7]=yellow; s[1][y1][7]=yellow; s[-1][y1][7]=yellow; s[-6][y1][3]=yellow; s[6][y1][3]=yellow; s[-6][y1][4]=yellow; s[6][y1][4]=yellow; for(int i=-7;i<8;i++){ for(int j=0;j<9;j++){ for(int c=-7;c<8;c++){ if(s[i][j][c]==" "){ s[i][j][c]="0,0"; continue; }else{ id=s[i][j][c].substr(0,s[i][j][c].find(",")); data=s[i][j][c].substr(s[i][j][c].find(",")+1); mc.setBlock(x+i,y+j,z,stoi(id),stoi(data)); } } } } return 0; }
标签:西瓜,错误,yellow,green,35,y1,black,red From: https://www.cnblogs.com/hanxuyao/p/17488047.html