2048Terminal 1.0.1

dotnet tool install --global 2048Terminal --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local 2048Terminal --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=2048Terminal&version=1.0.1
                    
nuke :add-package 2048Terminal --version 1.0.1
                    

Language: English | Tiếng Việt


<a id="english"></a>

English

2048 Terminal

A 2048 puzzle game for the terminal, built in C# (.NET 10) — themed ASCII rendering, undo, save and continue, and a persistent local high score board.

Install and Play

dotnet tool install --global 2048Terminal
play2048

Overview

2048 is a single-player sliding puzzle. Use the arrow keys or WASD to slide every tile on the 4x4 board in one direction. Two tiles with the same number merge into one when they touch, doubling that tile's value and adding it to the score. After every move, a new tile (2, or occasionally 4) appears in an empty cell. Reaching a 2048 tile shows a one-time "You Win!" notification, but play is not interrupted: the board stays fully playable afterwards (infinity mode), so the session only ends when the board is full and no more moves are possible.

Option Description
New Game Starts a fresh 4x4 board. If a game is already in progress, a confirmation prompt asks before it is discarded
Continue Resumes the last in-progress game (only shown when one exists)
High Scores Shows the top 10 saved scores with date and time
Settings Language, theme, colors, border style, animations
Quit Exits the game

Controls

Key Action
Arrow keys / WASD Move tiles up, down, left, or right
Z Undo the last move (single level)
R Restart the current game
ESC Return to the main menu (in-game) / exit (from the menu)
Enter Confirm a menu selection

Save and Continue

The board, score, and best score are saved automatically after every move to %AppData%\Game2048\save.json. If the game is closed while a board is still in progress — including after winning, thanks to infinity mode — the main menu's Continue option resumes it exactly where it was left off. The saved game is cleared only once the board is actually full with no legal moves left.

High Scores

Every finished game (the board fills up with no moves left) is recorded to a local leaderboard at %AppData%\Game2048\highscores.json, which keeps the top 20 scores. The High Scores screen displays the top 10, each with its score and the date and time it was achieved.

Themes

Switch themes from the Settings screen. A theme sets the border style together with matching primary and accent colors; the individual colors and the border style can also be changed independently.

Theme Border Primary Color
Classic Double Cyan
Matrix Single Green
Retro ASCII White
Neon Rounded Magenta

Settings

All settings persist between sessions in %AppData%\Game2048\settings.json:

  • Language — English or Vietnamese
  • Theme Preset — Classic, Matrix, Retro, or Neon
  • Primary and Accent Colors
  • Border Style — Double, Single, Rounded, or ASCII
  • Animations — spawn highlight and invalid-move feedback, on or off

Development

git clone https://github.com/trandat1114/2048_Terminal.git
cd 2048_Terminal
dotnet build
dotnet run --project 2048

No automated test suite exists yet; the game is verified through manual play-testing.

Advanced Usage

# Update to the latest version
dotnet tool update --global 2048Terminal

# Uninstall
dotnet tool uninstall --global 2048Terminal

<a id="tieng-viet"></a>

Tiếng Việt

2048 Terminal

Trò chơi giải đố 2048 chạy trên terminal, viết bằng C# (.NET 10) — hiển thị ASCII theo giao diện tùy chỉnh, hoàn tác, lưu và tiếp tục ván chơi, cùng bảng xếp hạng điểm cao lưu cục bộ.

Cài đặt và chơi

dotnet tool install --global 2048Terminal
play2048

Giới thiệu

2048 là trò chơi giải đố xếp ô dành cho một người chơi. Dùng phím mũi tên hoặc WASD để trượt toàn bộ các ô trên bàn cờ 4x4 theo một hướng. Hai ô có cùng giá trị khi chạm nhau sẽ gộp thành một ô có giá trị gấp đôi, đồng thời cộng vào điểm số. Sau mỗi nước đi, một ô mới (giá trị 2, đôi khi là 4) sẽ xuất hiện tại một ô trống. Khi tạo được ô có giá trị 2048, trò chơi hiển thị thông báo "Bạn đã thắng!" một lần duy nhất nhưng không dừng ván chơi: bàn cờ vẫn chơi tiếp được bình thường (chế độ vô hạn), ván chơi chỉ thực sự kết thúc khi bàn cờ đã đầy mà không thể di chuyển được nữa.

Mục Mô tả
New Game Bắt đầu ván chơi mới trên bàn cờ 4x4. Nếu đang có ván chơi dở, trò chơi sẽ hỏi xác nhận trước khi bỏ ván đó
Continue Tiếp tục ván chơi dở gần nhất (chỉ hiện khi có ván đang chơi)
High Scores Hiển thị 10 điểm cao nhất đã lưu, kèm ngày giờ đạt được
Settings Ngôn ngữ, giao diện, màu sắc, kiểu viền, hiệu ứng
Quit Thoát trò chơi

Điều khiển

Phím Chức năng
Phím mũi tên / WASD Di chuyển các ô lên, xuống, trái hoặc phải
Z Hoàn tác nước đi gần nhất (chỉ 1 cấp)
R Chơi lại ván hiện tại
ESC Về menu chính (trong ván chơi) / thoát (từ menu)
Enter Xác nhận lựa chọn trong menu

Lưu và tiếp tục

Bàn cờ, điểm số và điểm cao nhất được tự động lưu sau mỗi nước đi vào %AppData%\Game2048\save.json. Nếu thoát trò chơi khi ván đang dở — kể cả sau khi đã thắng, nhờ chế độ vô hạn — mục Continue ở menu chính sẽ khôi phục đúng trạng thái đã lưu. Ván đã lưu chỉ bị xóa khi bàn cờ thực sự đầy và không còn nước đi hợp lệ nào.

Điểm cao

Mỗi ván chơi kết thúc thật sự (bàn cờ đầy, không còn nước đi) đều được ghi vào bảng xếp hạng cục bộ tại %AppData%\Game2048\highscores.json, lưu tối đa 20 điểm cao nhất. Màn hình High Scores hiển thị 10 điểm cao nhất, kèm ngày giờ đạt được.

Giao diện

Đổi giao diện tại màn hình Settings. Mỗi giao diện thiết lập đồng thời kiểu viền cùng màu chính và màu nhấn phù hợp; có thể tùy chỉnh riêng lẻ từng màu và kiểu viền.

Giao diện Kiểu viền Màu chính
Classic Double Cyan
Matrix Single Green
Retro ASCII White
Neon Rounded Magenta

Cài đặt

Mọi thiết lập được lưu lại giữa các lần chơi tại %AppData%\Game2048\settings.json:

  • Language — Tiếng Anh hoặc Tiếng Việt
  • Theme Preset — Classic, Matrix, Retro hoặc Neon
  • Primary và Accent Colors
  • Border Style — Double, Single, Rounded hoặc ASCII
  • Animations — hiệu ứng khi sinh ô mới và khi di chuyển không hợp lệ, bật hoặc tắt

Phát triển

git clone https://github.com/trandat1114/2048_Terminal.git
cd 2048_Terminal
dotnet build
dotnet run --project 2048

Hiện chưa có bộ kiểm thử tự động; trò chơi được kiểm tra bằng cách chơi thử thủ công.

Sử dụng nâng cao

# Cập nhật lên phiên bản mới nhất
dotnet tool update --global 2048Terminal

# Gỡ cài đặt
dotnet tool uninstall --global 2048Terminal

License: MIT · Repository: https://github.com/trandat1114/2048_Terminal · NuGet: https://www.nuget.org/packages/2048Terminal

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.1 100 7/14/2026
1.0.0 96 7/13/2026
0.0.0-dev 83 7/13/2026

v1.0.0:
- Core 2048 engine: 4x4 board, Compress-Merge-Compress movement, win/lose detection
- ASCII renderer with per-value tile colors and spawn/shake animations
- Undo (single-level), Restart, and auto-saved Continue for in-progress games
- Main menu: New Game, Continue, High Scores, Settings, Quit
- High Scores: persistent local leaderboard (top 20, top 10 shown)
- Settings persistence: saved to %AppData%\Game2048\settings.json between sessions
- Theme system: 4 built-in themes (Classic, Matrix, Retro, Neon); dynamic border styles (Double, Single, Rounded, ASCII)
- English / Vietnamese localization