Anyone can play Google Hurdles today. Here is my score: 1.1 second. Is there are way of improving this score and running faster than a second?
http://www.google.com/doodles/hurdles-2012
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public class RunOlim {
private volatile static boolean run=true;
public static void main(String[] args) {
Robot robot = null;
Thread th = new Thread(new Runnable(){
@Override
public void run() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
run=false;
}
}
});
th.start();
try {
robot = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}
while(run){
robot.keyPress(KeyEvent.VK_RIGHT);
robot.keyRelease(KeyEvent.VK_RIGHT);
robot.keyPress(KeyEvent.VK_LEFT);
robot.keyRelease(KeyEvent.VK_LEFT);
}
}
}
