2048: Shortcut to 256

I recently got addicted to 2048 and one of the things that annoy me the most about the game is having to start over and work my way up to where I left off.

So I decided to write some code to solve that. Go to the game website and paste in this code in the Google Chrome Debug Console.

To open Chrome Debug Console press Cmd + Shift + C on a Mac or Ctrl + Shift + C on a PC. Then, paste in the following code and press Enter.


var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);

for (var i = 0; i < 40; i++) {
var e = document.createEvent("Event");
e.initEvent("keydown", true, true);e.keyCode = 37;
e.which = 37; document.dispatchEvent(e); e.keyCode = 40;
e.which = 40; document.dispatchEvent(e); e.keyCode = 39;
e.which = 39; document.dispatchEvent(e); e.keyCode = 40;
e.which = 40; document.dispatchEvent(e);e.keyCode = 37;
e.which = 37; document.dispatchEvent(e);
}

You can close the console by clicking the “X” on the top right corner. This takes you up to the 256th square. Hopefully, that’s enough of a start to help you figure out the rest.

Advertisements
This entry was posted in Code and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s