• Stars
    star
    543
  • Rank 79,034 (Top 2 %)
  • Language
    C
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Console version of the game "2048" for GNU/Linux

2048.c

Spanish

screenshot

Console version of the game "2048" for GNU/Linux

Gameplay

You can move the tiles in four directions using the arrow keys: up, down, left, and right. All numbers on the board will slide into that direction until they hit the wall and if they bump into each other then two numbers will be combined into one if they have the same value. Each number will only be combined once per move. Every move a new number 2 or 4 appears. If you have a 2048 on the board you have won, but you lose once the board is full and you cannot make a move.

Requirements

  • C compiler

Tested on: GNU/Linux, FreeBSD, OpenBSD

Installation

wget https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c
gcc -o 2048 2048.c
./2048

Running

The game supports different color schemes. This depends on ANSI support for 88 or 256 colors. If there are not enough colors supported the game will fallback to black and white (still very much playable). For the original color scheme run:

./2048

For the black-to-white color scheme (requires 256 colors):

./2048 blackwhite

For the blue-to-red color scheme (requires 256 colors):

./2048 bluered

Contributing

Contributions are very welcome. Always run the tests before committing using:

$ ./2048 test
All 13 tests executed successfully

More Repositories

1

php-crud-api

Single file PHP script that adds a REST API to a SQL database
PHP
3,499
star
2

php-api-auth

Single file PHP script that adds authentication to a PHP-CRUD-API project
PHP
171
star
3

php-crud-ui

Single file PHP script that adds a UI to a PHP-CRUD-API project
PHP
116
star
4

aoc-stats

Advent of Code statistics for the first 100 submissions visualized
HTML
77
star
5

php-sp-api

Single file PHP script that adds a REST API to a SQL database
PHP
49
star
6

java-crud-api

A Java port of the full php-crud-api project (single file REST API)
Java
45
star
7

php-crud-admin

A database admin interface for MySQL, PostgreSQL or SQL Server in a single file PHP script.
PHP
42
star
8

wped

Wikipedia client for the command line
PHP
38
star
9

shell.php

Web based shell access using PHP file
PHP
32
star
10

fakeflac

A command-line tool to detect "fake" FLAC files
Python
31
star
11

pythonista-minesweeper

Minesweeper game for iOS in Python (requires Pythonista)
Python
26
star
12

minesweeper.go

Minesweeper game in Go that can compile to WASM (uses ebiten v2)
Go
24
star
13

peg-solitaire.c

Console version of the game "peg-solitaire" for GNU/Linux
C
23
star
14

python-tictactoe

Python TicTacToe game with Tk GUI and minimax AI
Python
23
star
15

js-crud-api

A Node.js port of the full php-crud-api project (single file REST API)
JavaScript
20
star
16

go-crud-api

A Go port of the full php-crud-api project (single file REST API)
Go
14
star
17

json2xml.js

Two JavaScript functions that allow you to convert from JSON to XML and back
HTML
13
star
18

compress.php

Lossless compression of PHP files
PHP
12
star
19

daemon-games

Multi-player command line games for GNU/Linux
C
12
star
20

json2xml.php

Two PHP functions that allow you to convert from JSON to XML and back
PHP
11
star
21

MinJS.org

A minimalistic framework for web applications that uses JSON.
JavaScript
11
star
22

py-crud-api

A Python port of the full php-crud-api project (single file REST API)
Python
10
star
23

bitlocker-luks-tools

Shell
10
star
24

server-audit

Bash scripts that help you audit the system administration on a Linux server
Shell
9
star
25

lesspass-gui

A GUI for the lesspass.go package (written in Go)
Go
9
star
26

covid19reg

Coronavirus (COVID-19) registration tool written in PHP
PHP
7
star
27

core-data-api

A .net Core port of the full php-crud-api project (single file REST API)
C#
7
star
28

tail.php

Tail (follow) a remote file using a PHP script and telnet
PHP
7
star
29

go-soft-token

A text-based cross-platform TOTP token implementation written in Go.
Go
7
star
30

aspnetcorevb

The example "ASP.Net Core Web Application" ported from C# to Visual Basic
C#
7
star
31

json_sort.php

Sort a json string so that you can compare it using string comparison
PHP
6
star
32

AdventOfCode2019

Advent of Code 2019 puzzle solutions in Python
Python
5
star
33

youtube-playlist-extractor

Exracts links from YouTube playlists in MarkDown format
PHP
5
star
34

python-connect4

Python Connect4 game with AI using MTD(f) algorithm
Python
5
star
35

lesspass.py

A lesspass implementation in Python
Python
5
star
36

avalonia-vb-template-app

AvaloniaUI application template for Visual Basic .net
Visual Basic .NET
5
star
37

w3component.js

Tiny web component implementation in JavaScript
JavaScript
5
star
38

asset-proxy.php

A PHP proxy to make your website assets as high available as your site.
PHP
4
star
39

lesspass.php

A lesspass implementation in PHP
PHP
3
star
40

cli-support

Shell script to offer remote linux CLI support over SSH to users behind a NAT
Shell
3
star
41

gdpr-scanner

Scanner for GDPR compliance based on Puppeteer/PHP
PHP
3
star
42

AdventOfCode2018

Advent of Code 2018 puzzle solutions in Ruby
Ruby
3
star
43

slim-crud-api

A SlimPHP project that uses php-crud-api (automatic REST API) as a library
PHP
3
star
44

data-api-dot-net

A C# port of the full php-crud-api project (single file REST API)
C#
3
star
45

git-undelete-all.sh

Bash script to undelete everything that is easy to undelete in a Git repository.
Shell
2
star
46

win10iso2usb

Shell
2
star
47

aspnetcookie

A Go package that can decode an ASP.net FormsAuthentication encrypted cookie.
Go
2
star
48

pathalchemy

Path engine implementation in Python for PathQL
Python
2
star
49

copy_influxdb_data

Bash script that will save an influxdb time range as a separate database
Shell
2
star
50

TqdMemcacheBundle

Symfony bundle for Memcache Doctrine caching and session storage in the Web Debug Toolbar.
PHP
2
star
51

cdn.php

PHP
2
star
52

AdventOfCode2022

Advent of Code 2022 puzzle solutions in VB.net
Visual Basic .NET
2
star
53

tqdev-metrics

Light-weight Java library to measure critical components in a production environment.
Java
2
star
54

wake-domain.sh

Starts a KVM domain on a failed connection attempt from "auth.log"
Shell
1
star
55

postcodes-nl-geo

Dutch postcodes in CSV format (7zip) and MySQL import script (with geo)
PHP
1
star
56

lesspass.go

A lesspass implementation in Go
Go
1
star
57

synacor-challenge

Java
1
star
58

html_man_pages

A man page dictionary in HTML using a PHP script
PHP
1
star
59

pathpdo

Path engine implementation in PHP for PathQL
PHP
1
star
60

bootstrap-fluid-form

A fluid web form showcase using Bootstrap and vanilla PHP
PHP
1
star
61

AdventOfCode2016

Advent of Code 2016 puzzle solutions in PHP
PHP
1
star
62

Cravetivity.com

Cravetivity helps you discover and share creative websites.
PHP
1
star
63

laravel-todomvc

PHP
1
star