crobs/grunt.r
01 | /* Grunt, optimized by JS */ |
02 | /* originally by R. Polo */ |
03 | main() |
04 | { |
05 | int range,x; |
06 | while (1) |
07 | { |
08 | if (scan(x,10)!=0) |
09 | { |
10 | x+=5-(scan(x-5,5) != 0)*10; |
11 | x+=3-(scan(x-3,3) != 0)*6; |
12 | if ((range=scan(x,10))>20) |
13 | { |
14 | cannon(x,range); |
15 | if (range>200) |
16 | drive(x,50); |
17 | else |
18 | drive(180-x,0); |
19 | } |
20 | x-=20; |
21 | } |
22 | else |
23 | x+=20; |
24 | } |
25 | } |
26 |
|