#include <bits/stdc++.h> #include "minecraft.h" using namespace std; TxMinecraft mc; string meiju(string X,string Z){ string x,z; int id = 251,data = 15,cishu = 0; for(long long i = 0;i<108361;i++){ if(x==X){ cishu++; X = str.substr(0,find); Z = str.substr(find+1); meiju(X,Z); }else if(cishu>=2){ mc.drawLine(x,5,z,X,5,Z,id,data); }else{ mc.setBlock(x,5,z,id,data) } infile>>data; string str = data; int find = str.find(":"); x = str.substr(0,find); z = str.substr(find+1); X = str.substr(0,find); Z = str.substr(find+1); } } int main() { bool con = mc.ConnectMinecraft("zk.makeblock.net.cn","4cd7d6e558c943c397a3a5243fa78e19"); if(!con){ cout<<"连接失败"; } cout<<"连接成功"; char data[100]; ifstream infile; infile.open("数据.txt"); string X,Z; meiju("0","0"); return 0; }
标签:string,mc,substr,46,C++,八卦图,str,data,find From: https://www.cnblogs.com/wangyihang/p/16746802.html