Created
August 8, 2012 13:47
-
-
Save swapi/3295140 to your computer and use it in GitHub Desktop.
Beat the Google doodle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Robot; | |
import java.awt.event.KeyEvent; | |
public class TestRobot { | |
public static void main(String args[]) throws Exception { | |
Robot r = new Robot(); | |
int sleep = 500; | |
int i = 0; | |
for(;;) { | |
r.keyPress(KeyEvent.VK_SPACE); | |
Thread.sleep(sleep); | |
r.keyRelease(KeyEvent.VK_SPACE); | |
if(i > 15) sleep = 700; | |
if(i > 25) sleep = 800; | |
i++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment