2004/puma.r
01 | /* P U M A |
02 |
03 |
04 |
05 |
06 |
07 | Programmato da: Alessandro Carlin |
08 |
09 |
10 | Premessa: |
11 |
12 | Continua la saga "animalesca" dopo Falco, Tigre e Cobra quest'anno vanno di |
13 | moda i mammiferi con Puma e Coyote. In effetti visti i risultati potevo |
14 | chiamarli Pulce e Pidocchio... 20 minuti netti di test tra tutti e due e differenze |
15 | abbastanza marginali sui robot dell'anno scorso per il primo, moto a quadrato |
16 | per il secondo. |
17 |
18 | Strategia: |
19 |
20 | Vedi Tigre e cerca le differenze... un po' come |
21 | sulla settimana enigmistica |
22 |
23 | */ |
24 |
25 | int flagu,b,xa,ya,flag,flag1,nas,dri,d,oor,over,dver,danni,dor,daa,mm,ang,dr, do ,aq,rng,t,dir,oldr,deg,odeg,dist,yora,xora; |
26 |
27 | main(){ |
28 | if (ya=(loc_y()>500)) up(920); else dn(80); |
29 | if (xa=(loc_x(t=4)>500)) dx(920); else sx(80); |
30 | b=ya*2+(xa!=ya); |
31 | while (t<10000){ |
32 | daa=damage(flag1=2); |
33 | if (dver>0){ |
34 | if (xa){ |
35 | d=180; |
36 | sx(900); |
37 | dx(920); } |
38 | else { |
39 | d=0; |
40 | dx(100); |
41 | sx(80); } |
42 | dver-=((damage()-daa+1)); |
43 | } |
44 | else { |
45 | if (ya){ |
46 | d=270; |
47 | dn(900); |
48 | up(920); } |
49 | else { |
50 | d=90; |
51 | up(100); |
52 | dn(80); } |
53 | dver+=((damage()-daa+1)); |
54 | } |
55 | if (++t>4) |
56 | { |
57 | flag=flagu=90*b-30; |
58 | while (flag1&&flag<flagu+160) flag1-=(scan(flag+=20,10)>0); |
59 | t=10002*((flag1>0)); |
60 | } |
61 | } |
62 | while (1) |
63 | { |
64 | while (loc_y()>180) {zz(210,330); |
65 | } |
66 | while (loc_y()<820) {zz(150,30); |
67 | } |
68 | } |
69 | } |
70 |
71 | up(limt) { while (loc_y()<limt) {Fire(0,90);}drive(90,0);} |
72 | dn(limt) { while (loc_y()>limt) {Fire(0,270);}drive(270,0);} |
73 | dx(limt) { while (loc_x()<limt) {Fire(0,360);}drive(0,0);} |
74 | sx(limt) { while (loc_x()>limt) {Fire(0,180);}drive(180,0);} |
75 |
76 |
77 | Fire(qwe,po) |
78 | { |
79 | drive(po,100); |
80 | if ((oldr=scan(odeg=deg,10))&&(oldr<850)) { |
81 | if (!scan(deg+=355,5)) deg+=10; |
82 | if (!scan(deg+=357,3)) deg+=6; |
83 | cannon(deg+(deg-odeg)*qwe,2*scan(deg,10)-oldr); |
84 |
85 | } |
86 | else { |
87 | if (oldr=scan(deg+=340,10)) return cannon(deg,oldr); |
88 | if (oldr=scan(deg+=40,10)) return cannon(deg,oldr); |
89 | if (scan(d,10)) return (deg=d); |
90 | deg+=40; |
91 | } |
92 | } |
93 |
94 | zz(aw,bw){ |
95 | while (loc_x()>500) {Fire(1,aw);} |
96 | while (loc_x()<500) {Fire(1,bw);} |
97 | } |