首页 > 编程语言 >钟楼-c++

钟楼-c++

时间:2023-03-19 10:13:29浏览次数:37  
标签:钟楼 20 mc drawLine c++ fillBlocks data id

#include <iostream>
#include "minecraft.h"
using namespace std;
TxMinecraft mc;
int x,y,z,id,data;
void six(int x,int y,int z){

//地基 四个6*6正方形 空心
id=98,data=0;
y=y-1;
mc.drawLine(x,y,z,x+5,y,z,id,data);
mc.drawLine(x,y,z,x,y,z+5,id,data);
mc.drawLine(x,y,z+5,x+5,y,z+5,id,data);
mc.drawLine(x+5,y,z,x+5,y,z+5,id,data);
y=y+1;
}
void no1(){
//划4条连接线
id=98,data=0;
mc.fillBlocks(x+1,y,z+5,x+1,y+2,z+15,id,data);
mc.fillBlocks(x+5,y,z+1,x+15,y+2,z+1,id,data);
mc.fillBlocks(x+5,y,z+19,x+15,y+2,z+19,id,data);
mc.fillBlocks(x+19,y,z+5,x+19,y+2,z+15,id,data);

mc.drawLine(x+1,y+3,z+5,x+1,y+3,z+15,109,0);
mc.drawLine(x+5,y+3,z+1,x+15,y+3,z+1,109,2);
mc.drawLine(x+5,y+3,z+19,x+15,y+3,z+19,109,3);
mc.drawLine(x+19,y+3,z+5,x+19,y+3,z+15,109,1);
}
void no2(){
id=98,data=0;
mc.fillBlocks(x,y,z,x,y+3,z+6,id,data);
mc.fillBlocks(x,y,z+14,x,y+3,z+20,id,data);
mc.fillBlocks(x,y,z,x+6,y+3,z,id,data);
mc.fillBlocks(x+14,y,z,x+20,y+3,z,id,data);
mc.fillBlocks(x+20,y,z,x+20,y+3,z+6,id,data);
mc.fillBlocks(x+20,y,z+14,x+20,y+3,z+20,id,data);
mc.fillBlocks(x,y,z+20,x+6,y+3,z+20,id,data);
mc.fillBlocks(x+14,y,z+20,x+20,y+3,z+20,id,data);
id=109;
mc.drawLine(x,y+3,z,x,y+3,z+6,id,0);
mc.drawLine(x,y+3,z+14,x,y+3,z+20,id,0);
mc.drawLine(x,y+3,z,x+6,y+3,z,id,2);
mc.drawLine(x+14,y+3,z,x+20,y+3,z,id,2);
mc.drawLine(x+20,y+3,z,x+20,y+3,z+6,id,1);
mc.drawLine(x+20,y+3,z+14,x+20,y+3,z+20,id,1);
mc.drawLine(x,y+3,z+20,x+6,y+3,z+20,id,3);
mc.drawLine(x+14,y+3,z+20,x+20,y+3,z+20,id,3);
id=24;
mc.fillBlocks(x+1,y+4,z+1,x+1,y+6,z+5,id,data);
mc.fillBlocks(x+1,y+4,z+15,x+1,y+6,z+19,id,data);
mc.fillBlocks(x+1,y+4,z+1,x+5,y+6,z+1,id,data);
mc.fillBlocks(x+15,y+4,z+1,x+19,y+6,z+1,id,data);
mc.fillBlocks(x+19,y+4,z+1,x+19,y+6,z+5,id,data);
mc.fillBlocks(x+19,y+4,z+15,x+19,y+6,z+19,id,data);
mc.fillBlocks(x+1,y+4,z+19,x+5,y+6,z+19,id,data);
mc.fillBlocks(x+15,y+4,z+19,x+19,y+6,z+19,id,data);
id=155;
for(int i=4;i<7;i++){
mc.drawLine(x+2,y+i,z+2,x+18,y+i,z+2,id,0);
mc.drawLine(x+18,y+i,z+2,x+18,y+i,z+18,id,0);
mc.drawLine(x+2,y+i,z+2,x+2,y+i,z+18,id,0);
mc.drawLine(x+2,y+i,z+18,x+18,y+i,z+18,id,0);
}
}
void no3(){
id=155;
mc.drawLine(x+5,y,z+5,x-6,y,z+5,id,data);
mc.drawLine(x+5,y,z+5,x+5,y,z-6,id,data);
mc.drawLine(x+5,y,z-6,x-6,y,z-6,id,data);

}
int main(int argc, char** argv) {
bool con=mc.ConnectMinecraft("zk.makeblock.net.cn","4c4ce4431bdc409388e0a110f5aa9dcc");
if(!con){
cout<<"连接失败"<<endl;
return 0;
}
cin>>x>>y>>z;
mc.fillBlocks(x,y,z,x+100,y+100,z+100,0,0);
six(x,y,z);
six(x+15,y,z);
six(x,y,z+15);
six(x+15,y,z+15);
no1();
no2();
no3();
return 0;
}

标签:钟楼,20,mc,drawLine,c++,fillBlocks,data,id
From: https://www.cnblogs.com/hanxuyao/p/17231462.html

相关文章

  • SYNU PTA C++ 第三章实验题
    题目详细内容见PTA,仅提供答案参考。7-7冒泡1#include<iostream>2usingnamespacestd;34voidmerge(int*arr,intleft,intmid,intright)5{6......
  • C++ mutex,lock,unlock,lockguard
    //model/util.h#pragmaonce#include<algorithm>#include<chrono>#include<ctime>#include<fstream>#include<iomanip>#include<iostream>#include<map>......
  • 钟楼(未完成)
    #include<iostream>#include<string>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intmain(intargc,char**argv){boolcon=#include<......
  • mc 钟楼
    #include<iostream>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intmain(intargc,char**argv){ boolcon=mc.ConnectMinecraft("zk.makeblock.......
  • c++钟楼
    #include<iostream>#include<string>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intx,y,z,id,data;voida(){ //正方形 mc.fillBlocks(x,y-1......
  • 钟楼
    #include<iostream>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;voidno1(intx,inty,intz){intid,data;id=98;data=0;//台阶......
  • c++常用STL库及常用函数
    临近各种算法比赛,相信很多人想笔者一样还总是记不住很多函数的用法,特此总结一下常用的STL标准库以及标准函数,希望能够有所帮助。1.输入输出输入输出一般用两个标准库:#i......
  • c++ 影响多线程速度的因素记录
    目录0.序言1.缓存行同步问题/共享数据竞争1.1测试代码1.2测试逻辑1.3测试结果1.4小结2.任务颗粒度过小问题2.1测试代码2.1测试逻辑2.2测试结果2.3小结3.缓存未......
  • C++ class struct
    classandstruct目录前文问题对象与引用引用的传递对象copyshallowcopydepthcopymemcpy(data,a.data,sizeof(T)*n);简单类型复杂类型指针类型的......
  • C++ const的理解
    const​const修饰的变量不能再作为左值,初始化后值不能被修改C和C++const的区别​C语言中const修饰的值是常变量,不是常量,只是不能作为左值被修改voidmain(){......