1992/daitan3.r

01/*       Nome del robot:............DAITAN3             */
02/*   Autori:                            */
03/*        Deias Andrea                          */
04/*                                                  */
05/*        Filoni Gianluca                       */
06/*                                      */
07/*        DATA DI REALIZZAZIONE   29/9/92               */
08 
09 
10 
11 
12 
13int as;
14 
15main()
16 
17{
18 
19    while (loc_y() < 930) {
20        spara();
21        drive(90, 80);
22    }
23    spara();
24    drive(90, 0);
25    while (loc_x() > 70) {
26        spara();
27        drive(180, 80);
28    }
29    spara();
30    drive(180, 0);
31    while (1) {
32        while (loc_x() < 930) {
33            spara();
34            drive(0, 95);
35        }
36        spara();
37        drive(0, 0);
38        while (loc_y() > 70) {
39            spara();
40            drive(270, 85);
41        }
42        spara();
43        drive(270, 0);
44        while ((loc_x() > 70) && (loc_y() < 930)) {
45            spara();
46            drive(90, 80);
47        }
48        spara();
49        drive(90, 0);
50        while (loc_x() > 70) {
51            spara();
52            drive(180, 80);
53        }
54        spara();
55        drive(180, 0);
56        while (loc_x() < 930) {
57            spara();
58            drive(0, 95);
59        }
60        drive(0, 0);
61    }
62}
63 
64 
65spara()
66{
67    int range;
68    if (range = scan(as, 10)) {
69        cannon(as, (7 * range) / 8);
70        as -= 35;
71    } else
72        as += 20;
73}