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OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ8$88MD$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$DM$77$$$MMMMMMMMMMMMMMMMMMMMMMMM$88$$$MD$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$D8$$$$7$$$OMMMMMMMMMMMM$~??$$$$$8D$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$MMM$$$$7$~~~~:~~ ~~:~~~?$$$DDI$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$8888?~~~~~ ~ ~~~~888I$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$I8888888$?$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ===== ===== === ===== ===== ===== ======= ===== === === === === === ============= ==== ==== === ============= ============= === === === === === ==== ===== ===== ===== ===== =========== ===== ===== ===== ===== ============= ==== ===== ===== ===== ========= ========= ========= ========= ==== ==== ==== ==== ==== ==== ==== ==== === ==== ==== ==== ==== ==== ==== ==== ========= ==== ==== ==== ==== ==== ==== ===== ==== ==== ==== ==== ==== ==== ==== ========= ========= ========= ==== ===== ===== ===== Crobots : Hal9000 Type : Midi (Classic) Version : 13.04 Author : Maurizio Camangi Begin : 13-10-2024 Revision : 27-06-2025 HAL9000 v13 is an improved (!?) version of HAL9000 v12 (2020). Differences: - Slightly more aggressive - Switch side only if hit 1. A robot may not injure a human being or, through inaction, allow a human being to come to harm. 2. A robot must obey orders given to it by human beings, except where such orders would conflict with the First Law. 3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law. Zeroth Law. A robot cannot cause harm to humanity or, by inaction, allow humanity to come to harm. ATTENTION THIS C-ROBOT IS MADE OF 100% BITS IN THE UNLIKELY EVENT THAT IT COMES INTO CONTACT WITH ANTI-BITS OF ANY KIND, AN EXPLOSION WILL OCCUR WARNING THE ENTIRE UNIVERSE (INCLUDING THIS C-ROBOT) MIGHT SOMEDAY COLLAPSE INTO AN INFINITELY SMALL POINT IF ANOTHER UNIVERSE WERE TO EMERGE, THE EXISTENCE (AND FUNCTIONING) OF THIS C-ROBOT IN THAT UNIVERSE CANNOT BE GUARANTEED */ int ang, range, dir, posx, posy, x, y, deg1, timer, clock; degree(xx,yy) /* Direction to xx,yy */ int xx,yy; { return(dir=(360+((xx-=loc_x())<0)*180+atan(((yy-loc_y())*100000)/xx))); } dista(dx,dy) /* Square distance (avoid sqrt()) */ int dx,dy; { return (((dx-=loc_x())*dx+(dy-=loc_y())*dy)); } corner() /* Get closer to corner */ { int dist; drive(degree(x, y), 100); while( (dist = dista(x, y)) > 8100 ) { if(dist < 25600) ; else fire(dir); } fire2(0); while(speed()>59); if ( ++timer%12 == 1 ) { if (( (scan(deg1, 10)!=0) +(scan(deg1+20, 10)!=0) +(scan(deg1+40, 10)!=0) +(scan(deg1+60, 10)!=0) +(scan(deg1+80, 10)!=0) +(scan(deg1+100,10)!=0) ) < 2 ) { while(1) { if (((posx=loc_x())%880)<120) dir=180*(posx>500); else if (((posy=loc_y())%880)<120) dir=90+180*(posy>500); else if (range>610) dir=ang+25; else if (range<180) dir=ang+195; else dir=ang+180*(clock^=1); fire2(100); fire2(100); fire2(100); } } } } fire() { int asin,acos,oang,orange; if (speed()<100) drive(dir,100); else { if (scan(dir,10)) ang=dir; if (range>850) { ang+=120; } } if (scan(ang,10)) { asin=(sin(ang-dir)/14384); acos=(cos(ang-dir)/3796)-230; find(); if (orange=scan(oang=ang,3)) { find(); cannon(ang+(ang-oang)*((880+(range=scan(ang,10)))/482)-asin, range*230/(orange-range-acos)); } else search(); } else search(); } find() { if(scan(ang-13,10)) ang-=5; else if(scan(ang+13,10)) ang+=5; if(scan(ang+12,10)) ang+=4; else if(scan(ang-12,10)) ang-=4; if(scan(ang-11,10)) ang-=2; if(scan(ang+11,10)) ang+=2; } search() { if (range=scan(ang+=350,10)) return cannon(ang,range); if (range=scan(ang+=20,10)) return cannon(ang,range); if (range=scan(ang+=320,10)) return cannon(ang,range); if (range=scan(ang+=60,10)) return cannon(ang,range); if (range=scan(ang+=280,10)) return cannon(ang,range); search(ang-=220); } fire2(v) int v; { int oang; drive(dir,v); if (range=scan(oang=ang,10)) { if (scan(ang-8,5)) { if (scan(ang-=5,2)) ; else ang-=4; } else { if (scan(ang+8,5)) { if (scan(ang+=5,2)) ; else ang+=4; } else { if (scan(ang,1)) ; else if (scan(ang-=3,2)) ; else ang+=6; } } return(cannon((ang<<1)-oang,(scan(ang,10)<<1)-range)); } else { if(range=scan(ang+=20,10)) cannon(ang,range); else if(range=scan(ang-=40,10)) cannon(ang,range); else if(range=scan(ang+=60,10)) cannon(ang,range); else if(range=scan(ang-=80,10)) cannon(ang,range); else ang+=120; } } pod(delta) int delta; { int d; d=damage()+delta; while(dista(x,y) < (123450-4925*(damage(fire())>d))) ; } int radar(sc) int sc; { if ( scan(sc, 10) ) ; else if ( scan(sc+=20, 10) ) ; else return 0; ang = sc; return 1; } main() { int t, d, /* current damage */ dave, /* Dave, I am afraid I cannot do that... */ attack; /* 2 bits variable */ degree(x=20+960*(posx=loc_x()>499), y=20+960*(posy=loc_y()>499)); corner(deg1=90*((posy<<1)|(posx^posy))); while (dave=(t=1)<d) { attack&=~dave; clock^=1; } } else { /* defensive mode */ while((speed(fire())<100) || ((++t<3) && (damage()==d))) ; if(damage()>d) { pod(1); clock^=1; } else attack|=dave; } } else { /* ... otherwise go crazy */ dir=deg1 + 15 + (60*clock); pod(5);/* pod(3) */ attack|=dave; } corner(fire2()); } }