-
Notifications
You must be signed in to change notification settings - Fork 0
/
tibbeCrobot.r
1 lines (1 loc) · 2.93 KB
/
tibbeCrobot.r
1
int irtnkD,ngcpOA,istscnD,alltnkW,urntnkT,oneinZ,kfireO,ngppOA,istpcnSD;main(){kfireO=1;if(loc_y()>loc_x())drive((irtnkD=rand(80)+5-(loc_x()/11)-(loc_y()/11)),100);else drive((irtnkD=rand(80)+5+(loc_x()/11)+(loc_y()/11)),100);ngcpOA=irtnkD;cnLooDS(1);cnModDS(1);ngppOA=ngcpOA;istpcnSD=istscnD;while(1){if(kfireO){if(cnHoiDS()){if(istscnD<710 && istscnD>100){cannon(ngcpOA-((ngppOA-ngcpOA)/2),istscnD-((istpcnSD-istscnD)/2));}}else if(cnModDS(0)){}else if(cnLooDS(0)&& !alltnkW){if(cnModDS(1)&& !alltnkW){}}else if(cnLooDS(1)&& !alltnkW){if(cnModDS(1)&& !alltnkW){}}}if(alltnkW){if(urntnkT){if(loc_y()>loc_x())(irtnkD=rand(80)+5-(loc_x()/11)-(loc_y()/11));else(irtnkD=rand(80)+5+(loc_x()/11)+(loc_y()/11));urntnkT=0;}if(speed()<50){drive(irtnkD,100);alltnkW=0;kfireO=1;}}else{ngppOA=ngcpOA;istpcnSD=istscnD;if(loc_x()>900||loc_y()>900||loc_x()<100||loc_y()<100){if(!oneinZ){alltnkW=1;urntnkT=1;kfireO=0;oneinZ=1;drive(irtnkD,40);}}else{oneinZ=0;}}}}cnLooDS(cnfrstS){if(cnfrstS){if((istscnD=scan(ngcpOA,10))){return 1;}if((istscnD=scan(ngcpOA+10,10))){ngcpOA+=10;return 1;}if((istscnD=scan(ngcpOA-10,10))){ngcpOA-=10;return 1;}if((istscnD=scan(ngcpOA+30,10))){ngcpOA+=30;return 1;}if((istscnD=scan(ngcpOA-30,10))){ngcpOA-=30;return 1;}}if((istscnD=scan(ngcpOA+50,10))){ngcpOA+=50;return 1;}if((istscnD=scan(ngcpOA-50,10))){ngcpOA-=50;return 1;}if((istscnD=scan(ngcpOA+70,10))){ngcpOA+=70;return 1;}if((istscnD=scan(ngcpOA-70,10))){ngcpOA-=70;return 1;}if((istscnD=scan(ngcpOA+90,10))){ngcpOA+=90;return 1;}if((istscnD=scan(ngcpOA-90,10))){ngcpOA-=90;return 1;}if((istscnD=scan(ngcpOA+110,10))){ngcpOA+=110;return 1;}if((istscnD=scan(ngcpOA-110,10))){ngcpOA-=110;return 1;}if((istscnD=scan(ngcpOA+130,10))){ngcpOA+=130;return 1;}if((istscnD=scan(ngcpOA-130,10))){ngcpOA-=130;return 1;}if((istscnD=scan(ngcpOA+150,10))){ngcpOA+=150;return 1;}if((istscnD=scan(ngcpOA-150,10))){ngcpOA-=150;return 1;}if((istscnD=scan(ngcpOA+170,10))){ngcpOA+=170;return 1;}if((istscnD=scan(ngcpOA-170,10))){ngcpOA-=170;return 1;}return 0;}cnModDS(cnfrstS){if(cnfrstS){if((istscnD=scan(ngcpOA,5))){return 1;}if((istscnD=scan(ngcpOA+10,5))){ngcpOA+=10;return 1;}if((istscnD=scan(ngcpOA-10,5))){ngcpOA-=10;return 1;}if((istscnD=scan(ngcpOA+20,5))){ngcpOA+=20;return 1;}if((istscnD=scan(ngcpOA-20,5))){ngcpOA-=20;return 1;}}if((istscnD=scan(ngcpOA+30,5))){ngcpOA+=30;return 1;}if((istscnD=scan(ngcpOA-30,5))){ngcpOA-=30;return 1;}if((istscnD=scan(ngcpOA+40,5))){ngcpOA+=40;return 1;}if((istscnD=scan(ngcpOA-40,5))){ngcpOA-=40;return 1;}return 0;}cnHoiDS(){if((istscnD=scan(ngcpOA,3))){return 1;}if((istscnD=scan(ngcpOA+6,3))){ngcpOA+=6;return 1;}if((istscnD=scan(ngcpOA-6,3))){ngcpOA-=6;return 1;}if((istscnD=scan(ngcpOA+12,3))){ngcpOA+=12;return 1;}if((istscnD=scan(ngcpOA-12,3))){ngcpOA-=12;return 1;}if((istscnD=scan(ngcpOA+18,3))){ngcpOA+=18;return 1;}if((istscnD=scan(ngcpOA-18,3))){ngcpOA-=18;return 1;}if((istscnD=scan(ngcpOA+24,3))){ngcpOA+=24;return 1;}if((istscnD=scan(ngcpOA-24,3))){ngcpOA-=24;return 1;}return 0;}