aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
blob: a14a74351050ec4084b035cf91befd7d012b950c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 2048

CLI 2048 written in 2 kb.

```
$ wc -c **/*.c
 2048 2048.c
 5574 2048_clean.c
 2048 orig/2048.c
 4930 orig/2048_clean.c
14600 total
```


## Compile

```
$ make
```

By default, `2048.c` is compiled. If you want to compile another source file, set `SUFFIX` like this: `SUFFIX=_clean make` (it compiles `2048_clean.c`)


## Play

Execute the binary like this:

```
$ ./bin/2048
```

You can specify a grid size between 2 and 8. The default size is 4x4.

```
$ ./bin/2048 8x8    # large 2048
```


## Source Files

* `2048.c`
  * Minified version. Its file size is 2 KiB.
* `2048_clean.c`
  * Human-friendly version.
* `orig/2024.c` and `orig/2024_clean.c`
  * Original version. They depends on `ncurses` library.