#include <stdio.h>

#define BALL_DETECT 450
#define WHITE_LINE 800

// ダミー関数
void move(int left, int right)
{
    printf("move(%d, %d)\n", left, right);
}

void kick()
{
    printf("kick!\n");
}

int main()
{
    int ball_right  = 500;
    int ball_center = 300;
    int ball_left   = 700;
    int range       = 460;

    int floor_left  = 200;
    int floor_right = 300;

    // 白線回避
    if (floor_left > WHITE_LINE || floor_right > WHITE_LINE)
    {
        move(-50, -50);
        move(-50, 50);
        return 0;
    }

    // 左
    if (ball_left > ball_center &&
        ball_left > ball_right &&
        ball_left > BALL_DETECT)
    {
        move(-30, 30);
    }

    // 右
    else if (ball_right > ball_center &&
             ball_right > ball_left &&
             ball_right > BALL_DETECT)
    {
        move(30, -30);
    }

    // 正面
    else if (ball_center > BALL_DETECT)
    {
        move(50, 50);

        if (range > 450)
        {
            kick();
        }
    }

    // 見失い
    else
    {
        move(30, -30);
    }

    return 0;
}