Skip to main content

Play the popular game of 2048

A PyGTK implementation of Gabriele Cirulli’s game of 2048 which is itself a clone of 1024 and based on Saming’s 2048 (also a clone).

Installation

Open a terminal and enter the following command:

pip install py2048-game

In case you don’t have the right things installed and you don’t feel like installing them, there is still the old way that I created before I learned setuptools:

wget https://raw.githubusercontent.com/ralphembree/py2048/master/install.sh -q -O - | bash

The old way does a little bit more than the new way because I’m still learning the new way. Either one will create the py2048 executable, so the game can be started from the command prompt with a simple “py2048”. The old way, in addition, puts an entry in your Games menu.

Features

  • Moves can be undone with the click of a button.

  • Games can be saved in user-specified files to be resumed later.

  • Grid can be resized to preference.

  • In addition to the keyboard, there are two kinds of mouse interaction:

  • Swipe: click and hold and then move in the direction desired

  • Click: each section of the grid (top, bottom, left, right) when clicked will move the tiles in a different direction. The cursor will be an arrow pointing in the direction the tiles would go if you clicked.

  • The colors in the grid can be rerandomized at any time (without messing up your game).

Screenshot

Screencapture of game

How to play

The arrow keys determine which direction all of the tiles move. Tiles with the same number that hit each other merge into one tile. Each time tiles are moved, another tile is added to the board. The game is over when no more tiles can be merged.

Shortcut keys

Key

Action

Alt-N

Start new game

Ctrl-N

New grid size (user defined)

Alt-U/Ctrl-Z

Undo

Ctrl-C

New color scheme

Ctrl-M

Toggle mouse modes (swipe or click)

Ctrl-O

Load saved game

Ctrl-Shift-S

Save game under a different name

Ctrl-S

Save game to previously-defined file

F11

Toggle fullscreen

F1

Help

Ctrl-Q

Quit

License

py2048 is a Python implementation of the popular game of 2048. Copyright © 2014 Ralph Embree

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is destributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses

Release files for py2048-game 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py2048-game 1.0.1
File Size Uploaded
py2048-game-1.0.1.tar.gz 13.0 kB Details

Release files / py2048-game-1.0.1.tar.gz

Download URL py2048-game-1.0.1.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c918a9c8835b8573912a19600f30620217b4d3b07f9cc588011de60c30fd2535
BLAKE2b-256 checksum
How to use checksums
5cb89156e845cb0905ff29b8cbd1289b8907297dffa036987939ac0512c142c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page