changed alot of stuff. trying to make it faster.
changed alot of stuff. trying to make it faster.

restart abit. but better agains janne 6 now :)
tibbe78/tibbeCrobot,tibbe78/tibbeCrobot,tibbe78/tibbeCrobot
int ngppOA,istppOD,irtnkD,tnkrnTA,ngcpOA,istscnD,alltnkW,urntnkT,ngfpOA,istfpOD,ontprgC,tatscnS,arscnV;main(){if(loc_x()>500)drive((irtnkD=180),100);else drive((irtnkD=0),100);while(!ocanDS1(irtnkD)){}if(ocanDS2(ngcpOA)){ngppOA=ngcpOA;istppOD=istscnD;}while(1){if(ocanDS3(ngcpOA)){if(istscnD<700){if(ngcpOA>ngppOA)ngfpOA=ngcpOA+(istscnD>>6);else ngfpOA=ngcpOA-(istscnD>>6);if(istscnD>istppOD)istfpOD=istscnD+(istscnD>>7);else istfpOD=istscnD-(istscnD>>7);cannon(ngfpOA,istfpOD);}ngppOA=ngcpOA;istppOD=istscnD;}else{if(istppOD<50)ngcpOA=(ngcpOA+180);if(ocanDS2(ngcpOA)){ngppOA=ngcpOA;istppOD=istscnD;}else ocanDS3(ngcpOA);}if(loc_x()>850){drive((irtnkD=180),100);}if(loc_x()<150){drive((irtnkD=0),100);}}}ocanDS1(irstrtD){arscnV=15;if((istscnD=scan((ngcpOA=irstrtD),10))){return 1;}while(arscnV<=170){if((istscnD=scan((ngcpOA=irstrtD+arscnV),10))){return 1;}if((istscnD=scan((ngcpOA=irstrtD-arscnV),10))){return 1;}arscnV+=20;}return 0;}ocanDS2(irstrtD){arscnV=6;if((istscnD=scan((ngcpOA=irstrtD),4))){return 1;}while(arscnV<=24){if((istscnD=scan((ngcpOA=irstrtD+arscnV),4))){return 1;}if((istscnD=scan((ngcpOA=irstrtD-arscnV),4))){return 1;}arscnV+=8;}return 0;}ocanDS3(irstrtD){arscnV=3;if((istscnD=scan((ngcpOA=irstrtD),2))){return 1;}while(arscnV<=12){if((istscnD=scan((ngcpOA=irstrtD+arscnV),2))){return 1;}if((istscnD=scan((ngcpOA=irstrtD-arscnV),2))){return 1;}arscnV+=4;}return 0;}lcistCD(xx,yy){return sqrt(((loc_x()-xx)*(loc_x()-xx))+((loc_y()-yy)*(loc_y()-yy)));}lotrsPC(xx,yy){if(loc_x()-xx){if(yy>loc_y()){if(xx>loc_x())return atan((100000*(loc_y()-yy))/(loc_x()-xx));else return 180+atan((100000*(loc_y()-yy))/(loc_x()-xx));}else{if(xx>loc_x())return 359+atan((100000*(loc_y()-yy))/(loc_x()-xx));else return 180+atan((100000*(loc_y()-yy))/(loc_x()-xx));}}else{if(yy>loc_y())return 90;else return 270;}}

int osXppOP,osYppOP,ccppOA,osXcpOP,osYcpOP,cccpOA,ngcpOA,istcpOD,osXfpOP,osYfpOP,ccfpOA,istfpOD,irtnkD,owtnkP,pdtnkS,tnkosPX,tnkosPY,tatscnS,arscnV,istscnD;main(){tatscnS=0;pdosUP();irtnkD=lotrsPC(500,500);drive(irtnkD,100);if(ocanDS(irtnkD,10,170)){if(ocanDS(ngcpOA,4,24)){if(ocanDS(ngcpOA,2,12)){pdosUP();if(istcpOD<700){cannon(ngcpOA,istcpOD);}}}}while(1){if(ocanDS(ngcpOA,2,12)){pdppUO();if(istcpOD<700){cannon(ngcpOA,istcpOD);}else{if(ocanDS(ngcpOA,1,5)){pdosUP();}}}else{if(ocanDS(ngcpOA,4,24)){}else{ocanDS(ngcpOA,10,170);}}}}pdosUP(){tnkosPX=loc_x();tnkosPY=loc_y();}rvirDD(){pdtnkS=speed();}pdppUO(){tnkosPX=loc_x();tnkosPY=loc_y();osXppOP=istcpOD*cos(ngcpOA)+tnkosPX;osYppOP=istcpOD*sin(ngcpOA)+tnkosPY;}ocanDS(irstrtD,esscnR,dthscnW){arscnV=esscnR+(esscnR>>1);if((istscnD=scan(irstrtD,esscnR))){ngcpOA=irstrtD;istcpOD=istscnD;return 1;}while(arscnV<=dthscnW){if((istscnD=scan(irstrtD+arscnV,esscnR))){ngcpOA=irstrtD+arscnV;istcpOD=istscnD;return 1;}if((istscnD=scan(irstrtD-arscnV,esscnR))){ngcpOA=irstrtD-arscnV;istcpOD=istscnD;return 1;}arscnV+=(esscnR+esscnR);}return 0;}lcpCOXY(){}lcistCD(xx,yy){return sqrt(((tnkosPX-xx)*(tnkosPX-xx))+((tnkosPY-yy)*(tnkosPY-yy)));}lotrsPC(xx,yy){if((tnkosPX-xx)==0){if(yy>tnkosPY)return 90;else return 270;}else{if(yy>tnkosPY){if(xx>tnkosPX)return atan((100000*(tnkosPY-yy))/(tnkosPX-xx));else return 180+atan((100000*(tnkosPY-yy))/(tnkosPX-xx));}else{if(xx>tnkosPX)return 359+atan((100000*(tnkosPY-yy))/(tnkosPX-xx));else return 180+atan((100000*(tnkosPY-yy))/(tnkosPX-xx));}}}
