image thumbnail

2048 MATLAB Edition

version 1.1.0.1 (54.1 KB) by jiro
This is a MATLAB implementation of the 2048 game

8.1K Downloads

Updated01 Sep 2016

View License

Editor's Note:This file was selected as MATLAB CentralPick of the Week

2048 is a game originally created by Gabriele Cirulli. This is a MATLAB implementation of the game.
For users of R2012b or newer, install the app. For older versions of MATLAB, you can run "play2048" inside the "NonAppVersion" folder. You must be using MATLAB R2009b or newer.
There's also a simulator where you can test out your own game solving algorithm. The algorithm must be a MATLAB function with the signature:
function direction = myfcn(board)

“野猪d" is a 4x4 matrix of numbers representing the game board (NaN for empty spots), and "direction" is a character array representing the direction to move the blocks, i.e. 'up', 'down', 'right', or 'left'.

Read "readme.txt" for more information.

Cite As

jiro (2022).2048 MATLAB Edition(//www.tianjin-qmedu.com/matlabcentral/fileexchange/46124-2048-matlab-edition), MATLAB Central File Exchange. Retrieved.

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!