Home Screen ProgramGuide Commands Weapons Legs

Program Guide

The Flow of the Program

  • The program begins with start connector "START".
Start connector
"START"

Normal Flow

  • If you have side-by-side instruction , processing will see the direction of travel advances.
  • If you want to change the direction of the processing , use the line block.
The process begins from the "START",
Proceed as red arrow.

Special Lines

  • If you have entered from the side to the merging line (A and B), the process will proceed in a downward direction.
  • Cross line (C) will connect the up and down / left and right .
  • Direction of process does not change at the cross line.

Start Connectors and Jump Connectors

  • Use the start connector and jump connector, you can skip the processing to a remote location.
  • Processing will move to the start connector of the same number from the jump connector.
Processing will shift
from the jump connector,
to the start connector
of the same number.

Conditional branching and Y / N line

  • If the command is carried out some sort of judgment, the process will branch by the determination result.
  • If the condition is met, the process go to YES line , otherwise go to NO line.
  • If the command does not have a line of YES and NO, it will result in an error.
Branches to YES in a probability of 20%,
Branches to NO with 80% probability.

 

Basic Programs

Tutrial 1 : Walk Around the Field

First of all, let's program to walk around in the battle field. Turning to the right if there is an object that prevents the movement of the robot forward, if not to move forward, it is a simple program. Using the robot " Tutorial-1 ", please check the actual operation.
In DIRECTION AT-RB FRONT, it will examine whether there are things that interfere with the movement of the robot forward.

Tutrial 2 : Find Enemy Robot

Next, let's add a process that faces towards the enemy If you find the enemy. Turning to the right when you have an enemy in the right front, and add the turning to the left when you have an enemy in the left front. It will be advancing toward the enemy.
If you specify ENEMY, you can find out
whether the enemy is present.

FR-R is a front right direction,
FR-L is a front left direction.

Tutrial 3 : Attack to the Enemy Robot

Let your robot attack to the enemy. Add the process of attack if the enemy is in the front. This prima facie, is the completion of the program to be able to combat.

In "ATTACK WPN1 USE",
use the weapon 1.

 

Examples of general-purpose processing

Determin whether the ray until the enemy is through

  • To only shoot when there is no obstacle blocking the bullet between the enemy , you can use a program such as the following .
  • The distance between the enemy is counted in HEX unit .
  • If the distance is 1HEX, then shoot .
  • When the distance is 2 to 3 , fire if there is no obstacle within 2HEX.
  • More distant when the shooting if there is no obstacle within 4HEX.

Search all directions

  • To check whether there is an enemy in all directions, you can use a program such as the following.

Information for advanced users

Compression of the program

  • If you try to create a clever robot , it has become necessary to pack efficiently instruction to a limited program area.
  • If you use well the merging line and cross the line , you can reduce the area of ​​the program.
  • If the same instruction is in various places , you can reduce the number of instruction by sharing them.
  • The following program is obtained by compressing rays judgment of the program that was just introduced.
  • But exactly the same behavior , the number of blocks to be used has decreased.
2 block reduction at the merging line and the cross- line,
ATTACK → START to share to 2 block reduction,
a total of four blocks has been reduced.

 Detailed specifications of the program transition

  • If you want to write complex programs , you need to know exactly how the program transition to.
  • See below for it.
  • If the current block is the start connectors , it transitions to block below .

  • If the current block is a jump connector , the transition to start the connector of the same number .

    • If the start connector there is more than one , the transition to those close to the upper left .

  • If the current block is a decision block and the result is YES , the transition to YES line.

    • However, it does not return to the line passing through.

    • If multiple YES lines are connected , the order of priority is made ​down , right , left , up .

  • If the current block is a decision block and the result is NO , the transition to NO line.

    • However, it does not return to the line passing through.

    • If multiple NO lines are connected , the order of priority is made ​down , right , left , up .

  • The current block is the case of an instruction block ( don't branch ) , the transition destination is determined in the following order .

    • If there is a jump connector below the current block , the transition below.

    • When the line is connected to the current block, a transition to the line.

    • However, it does not return to the line passing through.

    • If multiple lines are connected , the order of priority is made ​down , right , left , up .
  • If it does not meet the above , the transition to the straight direction.


©2016 Lighthouse Labo. All rights are reserved.