Skip to content

2048 plus replays, plus undo, plus some other stuff too.

License

Notifications You must be signed in to change notification settings

sdmtr/2048PlusPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048PlusPlus

This is the good old game 2048 with replays, undo, nicer colours (with a colour picker if you're so inclined), and milestones. It doesn't stop at 2048, nor does it stop when you have no more moves left.

While playing, hit 'z' to undo the most recent move. The undo history goes all the way back to the beginning.

As you play, the replay textarea fills up with a code you can share with other players. To replay someone else's code, just paste it into the textarea and click the play button. There are some pre-made replays in the replays/ directory if you want to check them out.

You can adjust the delay between each replay move using the up and down arrow buttons. If the speed is set to 0, the replayer will try and make 200 moves at a time to speed things up. Even so, very long replays can still take several minutes to run.

You can pause the replay at any point. If you click the stop button while a replay is running or paused, the current replay is truncated and you can continue playing from that point.

If you want to change the colours of the tiles, change the display attribute of #tile-debug to block (it's defined in index.html near the top of the document) and refresh the page. There'll be a line of tiles at the top of the page which you can click and edit as you see fit. When you're done, click the copy button to copy some CSS to your clipboard and then paste it over the top of the .tile-*-color definitions in tiles.css.

There's the ghost of an AI in ai_manager.js that isn't even a little bit functional, so feel free to mess around with it and submit a pull request, or just fork this repo and do what you want forever. vgrid.js has a class which can ingest the current game board and resolve it in whichever direction you like, which your AI implementation can use to simulate outcomes.

I've only tested this in Chrome on macOS. None of this works on mobile because I don't know how to debug javascript on mobile Safari and also I'm very lazy.

Based on the original 2048 by Gabriele Cirulli.

About

2048 plus replays, plus undo, plus some other stuff too.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published