Skip to content

Instantly share code, notes, and snippets.

@christianroman
Created August 8, 2012 18:42
Show Gist options
  • Save christianroman/3297420 to your computer and use it in GitHub Desktop.
Save christianroman/3297420 to your computer and use it in GitHub Desktop.
Google Basketball Doodle Hack
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public class GoogleDoodle {
static {
try {
Robot r = new Robot();
Thread.sleep(2000);
int b[]={1,5,4,4,1,3,2};
int t[]={400,400,575,820,850,1150,1350};
int z[]={200,650,700,600,400,450,400};
for (int i=0;i<b.length;i++)
for (int j=0;j<b[i];j++){
r.keyPress(KeyEvent.VK_SPACE);
r.delay(t[i]);
r.keyRelease(KeyEvent.VK_SPACE);
r.delay(z[i]);
}
} catch(AWTException e){;} catch(InterruptedException e){;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment