﻿import java.awt.Robot;
import java.awt.event.KeyEvent;

public class Main {

    private static final int L = KeyEvent.VK_A;
    private static final int R = KeyEvent.VK_D;
    private static final int J = KeyEvent.VK_SPACE;

    private static Robot r;

    public static void main(String[] args) throws Exception {
        r = new Robot();

        p("Delay 1000");
        d(1000);
        p("Start");

        a(R, 500);
        a(J,  50);
        d(   700);
        a(R, 500);
        d(   150);
        a(L, 700);
        d(  1400);
        a(R, 250);
        d(   350);
        a(L, 300);
        d(   500);
        a(R, 200);

        d(   150);
        a(J,  50);

        a(L, 250);
        d(   250);
        a(R, 500);
        d(   300);
        a(L, 280);
        d(  1350);
        a(R, 700);
        d(   150);
        a(L, 500);

        p("Done");
    }

    private static void d(int d) {
        r.delay(d);
    }

    private static void a(int k, int d) {
        r.keyPress(k);
        r.delay(d);
        r.keyRelease(k);
    }

    private static void p(String str) {
        System.out.println(str);
    }
}

