Official Technical Documentation
2048 Nexus Documentation
Complete documentation covering pre-built binary installers (Windows .exe, Debian .deb, Fedora/RHEL .rpm), tile spawn probability formulas, Expectimax AI heuristic algorithm, and PyQt6 desktop packaging.
2048 Nexus Technical Overview
2048 Nexus is an open-source, hardware-accelerated desktop puzzle game implementation engineered in Python using PyQt6 and Qt Graphics View. It supports custom grid geometry from 3x3 to 8x8, unlimited move undo history, real-time expectimax AI calculation, and standalone installer packaging.
Installation & Pre-built Packages
2048 Nexus is distributed both as standalone pre-built executable binaries for major operating systems and as an open-source Python application. Choose your preferred installation method below:
Pre-built Binary Installers (Recommended)
Package Manager Installation
# --- Debian / Ubuntu / Linux Mint (.deb) ---
# 1. Download the package
wget https://github.com/dev-hints/2048-Nexus/releases/download/1.0.0/2048-nexus.deb
# 2. Install using dpkg
sudo dpkg -i 2048-nexus.deb
# 3. Resolve any missing dependencies (if required)
sudo apt-get install -f
# --- Fedora / RHEL / CentOS Stream (.rpm) ---
# Install directly via DNF:
sudo dnf install https://github.com/dev-hints/2048-Nexus/releases/download/1.0.0/2048-nexus-1.0.noarch.rpm
# Or install downloaded RPM:
sudo rpm -ivh 2048-nexus-1.0.noarch.rpm
Build & Run from Python Source
If you prefer running from source or developing custom AI heuristics, clone the repository and run with Python 3.10+:
# Clone the repository
git clone https://github.com/dev-hints/2048-Nexus.git
cd 2048-Nexus
# Optional: Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install PyQt6 pygame numpy
# Launch with default 4x4 grid
python main.py
# Launch 5x5 board with AI auto-solver enabled
python main.py --mode 4x4 --ai-enabled
System Compatibility & Requirements
| Platform | Supported Versions | Installer Format | Architecture |
|---|---|---|---|
| Windows | Windows 10, Windows 11 | .exe Installer / Standalone Binary |
x86_64 |
| Debian / Ubuntu | Ubuntu 20.04+, Debian 11+, Mint 20+, Pop!_OS | .deb Package |
x86_64 / noarch |
| Fedora / RHEL | Fedora 35+, RHEL 8+, CentOS Stream 9+, Rocky, Alma | .rpm Package |
x86_64 / noarch |
| Source (Python) | macOS 11+, FreeBSD, Any Linux distro | pip / Git Source |
Universal (Python 3.10+) |
Tile Probability & Scoring Matrix
Every valid swipe shifts non-zero matrix elements towards the vector edge. Consecutive matching pairs merge into their power of two sum:
Score_Add = Tile_A + Tile_B = 2^(k+1)
| Event | Probability | Conditions |
|---|---|---|
| Spawn Tile '2' | 90.0% | Random empty grid coordinate |
| Spawn Tile '4' | 10.0% | Random empty grid coordinate |
| Game Over | Deterministic | 0 empty cells & 0 adjacent merge pairs |
Expectimax AI Heuristic Solver
The auto-solver searches game tree states up to depth 5 using an Expectimax model with four weighted evaluation heuristics:
# Expectimax node evaluation score
Total_Score = (3.5 * corner_score) + (2.2 * monotonicity) + (1.0 * smoothness) + (2.8 * empty_cells)
PyQt6 Architecture & Subsystems
2048 Nexus is engineered with a modular separation of concerns designed for maximum frame rendering performance and testable AI integration:
QThread to maintain seamless GUI responsiveness during deep searches.
Keyboard Controls Reference
| Key Binding | Action |
|---|---|
Arrow Keys / W A S D | Move tiles in direction |
U / Ctrl + Z | Undo last move |
Spacebar | Execute single AI suggested step |
A | Toggle continuous AI auto-play mode |
R | Restart game session |