; RoboCom program ; Instead of having to change all the values below with every new program, ; it's suggested that you adjust the template header to your needs once ; in the Prefs->Editor dialog. You can also remove these comments. ; See documentation for the meaning of these and more header fields. Published Name figure-flag-v2 ; Name of this program Published Author Rick van der Zwet ; Name of author Published EMail hvdzwet@liacs.nl ; Author's e-mail address Published Country The Netherlands ; Author's home country Published Comment Part AI Course @ LIACS ; A comment on this prog Secret Password YOUR_PASSWORD_HERE ; Password for competitons Published OpenSource yes ; This prog is open source Published Language RC300 ; Written in RC300 language Published OptionSet Classic ; Recommended OptionSet Bank Flag @Start ;Indentify field Scan #1 Comp #1,0 Jump @FieldBusy ;New robot Create 2,1,0 Scan #1 Comp #1,2 Jump @EnemyBot Trans 1,1 Set %active,#active Jump @ScanForDieMode ;Indentify enemy or friendly @FieldBusy Comp #1,2 Jump @EnemyBot ;We completed the tail, let's check whether ;we are next to some other friend @FriendlyBot Turn 0 Scan #1 Turn 0 Turn 0 Scan #2 Turn 0 Comp #1,0 Jump @ScanForDieMode Comp #2,0 Jump @ScanForDieMode Comp #active,1 Jump @EnemyBot Set #active,2 Turn 0 Jump @Start ;Start looking whether we need to kill ourself @ScanForDieMode Comp %active,3 Jump @ScanForDieMode Set #active,3 ;Delay to allow 'message' to pass trough Turn 0 Turn 0 Turn 0 Die ;If enemy bot, start looking which direction we are in @EnemyBot Set #active,3 ; enable destruction of tail ;Delay to allow 'message' to pass trough Turn 0 Turn 0 Turn 0 Set #active,1