Created
September 13, 2023 12:43
-
-
Save justinledwards/93c1f0267383451558ae071b3d913987 to your computer and use it in GitHub Desktop.
Snake cheat
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
let e=e=>new Promise(t=>setTimeout(t,e)),c=e=>e.charCodeAt(),a=e=>"Arrow"+e,k=e=>{let t=new KeyboardEvent("keydown",{key:e,code:e,keyCode:c(e),which:c(e)});document.dispatchEvent(t)},t=(t,o)=>e(t).then(()=>k(a(o))),l=async()=>{for(let e=0;e<1e9;e++)await t(30,"Left"),await t(720,"Up"),await t(30,"Right"),await t(780,"Up")};e(90).then(l); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment