Created
October 6, 2012 23:04
-
-
Save zeusdeux/3846455 to your computer and use it in GitHub Desktop.
A google hurdle hack that lets you get a time of 0.1s
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
/************************************************************** | |
Author: Mudit Ameta | |
Date : 9Aug12 | |
Link : http://experiments.muditameta.com/googleHurdleHack/ | |
***************************************************************/ | |
(function () { | |
var game = document.getElementById('hplogo'); | |
var leftDown = document.createEvent("Event"); | |
leftDown.initEvent("keydown", true, true); | |
leftDown.keyCode = 37; | |
var leftUp = document.createEvent("Event"); | |
leftUp.initEvent("keyup", true, true); | |
leftUp.keyCode = 37; | |
var rightDown = document.createEvent("Event"); | |
rightDown.initEvent("keydown", true, true); | |
rightDown.keyCode = 39; | |
var rightUp = document.createEvent("Event"); | |
rightUp.initEvent("keyup", true, true); | |
rightUp.keyCode = 39; | |
game.focus(); | |
for (i = 0; i < 1000; i++) { | |
game.dispatchEvent(leftDown); | |
game.dispatchEvent(leftUp); | |
game.dispatchEvent(rightDown); | |
game.dispatchEvent(rightUp); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment