https://github.com/alyyousuf7/twenty48
2048 game on CLI
https://github.com/alyyousuf7/twenty48
2048 2048-game cli golang
Last synced: about 1 year ago
JSON representation
2048 game on CLI
- Host: GitHub
- URL: https://github.com/alyyousuf7/twenty48
- Owner: alyyousuf7
- License: mit
- Created: 2018-04-30T10:59:17.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-17T11:27:28.000Z (over 6 years ago)
- Last Synced: 2025-04-01T14:58:09.961Z (about 1 year ago)
- Topics: 2048, 2048-game, cli, golang
- Language: Go
- Size: 57.6 KB
- Stars: 53
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twenty48
[](https://circleci.com/gh/alyyousuf7/twenty48) [](https://codecov.io/gh/alyyousuf7/twenty48)
Play 2048 from CLI

Use up, down, left and right arrow keys to play, and `ESC` to quit.
The default grid size is `8x8` which can be changed be setting `-width` and `-height` flags.
```bash
$ twenty48 [-width=8] [-height=8]
```
## Install
Requires Golang:
```bash
$ go get -u github.com/alyyousuf7/twenty48/cmd/twenty48
```
## Development
On host machine with Golang installed:
```bash
$ make test # execute test
$ make binary # build the executable in bin/
```
Or using Docker:
```bash
$ make shell # jump into a container
root@container:/twenty48# make test
root@container:/twenty48# make binary
root@container:/twenty48# exit
```
The Docker container mounts a volume to `bin/` to copy executable to host machine.
## TODOs
- [ ] Write more tests
- [ ] Maintain scoreboard
- [ ] Display game over text
PRs are most welcome!
## License
[MIT](./LICENSE)