added som more scanning functionality
added som more scanning functionality

still stupid as a rock though.
tibbe78/tibbeCrobot,tibbe78/tibbeCrobot,tibbe78/tibbeCrobot
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));}}}

int axldMbF,pPosXpO,pPosYpO,ccpApO,pPosXcO,pPosYcO,ccpAcO,ngpAcO,istpDcO,pPosXfO,pPosYfO,ccpAfO,istpDfO,ngmaxR,irtnkD,izetnkS,irgunD,pdtnkS,tnkX,tnkY,owtnkP,istscnD,axbndM,inbndM,caletS,TWOPI,counter,RAD2DEG;main(){tnkX=loc_x();tnkY=loc_y();irtnkD=earingB(500,500);drive(irtnkD,100);if(canSoD(irtnkD,10,170)){if(canSoD(ngpAcO,4,24)){if(canSoD(ngpAcO,1,7)){if(canSoD(ngpAcO,0,4)){cannon(ngpAcO,istpDcO);}}}}while(1){cannon(ngpAcO,istpDcO);}}osPpdU(){pedtnkS=speed();tnkX=loc_x();tnkY=loc_y();}canSoD(irstrtD,res,width){int v,s;v=res+(res/2);if((s=scan(irstrtD,res))){ngpAcO=irstrtD;istpDcO=s;return 1;}while(v<=width){if((s=scan(irstrtD+v,res))){ngpAcO=irstrtD+v;istpDcO=s;return 1;}if((s=scan(irstrtD-v,res))){ngpAcO=irstrtD-v;istpDcO=s;return 1;}v+=(res+res);}return 0;}istD(xx,yy){return sqrt(((tnkX-xx)*(tnkX-xx))+((tnkY-yy)*(tnkY-yy)));}earingB(xx,yy){if((tnkX-xx)==0){if(yy>tnkY)return 90;else return 270;}else{if(yy>tnkY){if(xx>tnkX)return atan((100000*(tnkY-yy))/(tnkX-xx));else return 180+atan((100000*(tnkY-yy))/(tnkX-xx));}else{if(xx>tnkX)return 359+atan((100000*(tnkY-yy))/(tnkX-xx));else return 180+atan((100000*(tnkY-yy))/(tnkX-xx));}}}