Function Repository Resource:

Play2048

Source Notebook

Play a game of 2048

Contributed by: Bob Sandheinrich

ResourceFunction["Play2048"][n]

creates a notebook containing an nn game of 2048.

Details and Options

Play using either the arrow keys or the w,a,s,d keys.
The new tile is shown with a green border.

Examples

Basic Examples (1) 

Play a standard 4×4 game of 2048:

In[1]:=
ResourceFunction[
 "Play2048", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][]
Out[1]=

Scope (2) 

Play a 3×3 game:

In[2]:=
ResourceFunction[
 "Play2048", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][3]
Out[2]=

Play a 5×5 game:

In[3]:=
ResourceFunction[
 "Play2048", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][5]
Out[3]=

Publisher

Bob

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 2.1.0 – 14 February 2025
  • 2.0.0 – 10 May 2019
  • 1.0.0 – 19 April 2019

Source Metadata

Related Resources

Author Notes

Version 2.1.0: Fixed arrow keys for Mac keyboards. Added green frame to new tile. Added victory and game over messages inside the game frame instead of using Print

License Information