source: liacs/ai/robocom/figure-flag-v2.rob@ 273

Last change on this file since 273 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 2.0 KB
Line 
1; RoboCom program
2
3; Instead of having to change all the values below with every new program,
4; it's suggested that you adjust the template header to your needs once
5; in the Prefs->Editor dialog. You can also remove these comments.
6; See documentation for the meaning of these and more header fields.
7
8Published Name figure-flag-v2 ; Name of this program
9Published Author Rick van der Zwet ; Name of author
10Published EMail hvdzwet@liacs.nl ; Author's e-mail address
11Published Country The Netherlands ; Author's home country
12Published Comment Part AI Course @ LIACS ; A comment on this prog
13Secret Password YOUR_PASSWORD_HERE ; Password for competitons
14
15Published OpenSource yes ; This prog is open source
16Published Language RC300 ; Written in RC300 language
17Published OptionSet Classic ; Recommended OptionSet
18
19Bank Flag
20 @Start
21 ;Indentify field
22 Scan #1
23 Comp #1,0
24 Jump @FieldBusy
25
26 ;New robot
27 Create 2,1,0
28 Scan #1
29 Comp #1,2
30 Jump @EnemyBot
31 Trans 1,1
32 Set %active,#active
33 Jump @ScanForDieMode
34
35 ;Indentify enemy or friendly
36 @FieldBusy
37 Comp #1,2
38 Jump @EnemyBot
39
40 ;We completed the tail, let's check whether
41 ;we are next to some other friend
42
43 @FriendlyBot
44 Turn 0
45 Scan #1
46 Turn 0
47 Turn 0
48 Scan #2
49 Turn 0
50
51 Comp #1,0
52 Jump @ScanForDieMode
53 Comp #2,0
54 Jump @ScanForDieMode
55 Comp #active,1
56 Jump @EnemyBot
57 Set #active,2
58 Turn 0
59 Jump @Start
60
61 ;Start looking whether we need to kill ourself
62 @ScanForDieMode
63 Comp %active,3
64 Jump @ScanForDieMode
65 Set #active,3
66 ;Delay to allow 'message' to pass trough
67 Turn 0
68 Turn 0
69 Turn 0
70 Die
71
72 ;If enemy bot, start looking which direction we are in
73 @EnemyBot
74 Set #active,3 ; enable destruction of tail
75 ;Delay to allow 'message' to pass trough
76 Turn 0
77 Turn 0
78 Turn 0
79 Set #active,1
Note: See TracBrowser for help on using the repository browser.