GithubHelp home page GithubHelp logo

twenty48's Introduction

Twenty48

CircleCI codecov

Play 2048 from CLI

2048 on 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.

$ twenty48 [-width=8] [-height=8]

Install

Requires Golang:

$ go get -u github.com/alyyousuf7/twenty48/cmd/twenty48

Development

On host machine with Golang installed:

$ make test   # execute test
$ make binary # build the executable in bin/

Or using Docker:

$ 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

twenty48's People

Contributors

alyyousuf7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

twenty48's Issues

Broken for Ubuntu on Windows

 ><>  ~ > twenty48 -width=8 -height=8                  
panic: invalid argument

goroutine 1 [running]:
main.startGame(0x8, 0x8)
        /home/24G/go/src/github.com/alyyousuf7/twenty48/cmd/twenty48/game.go:13 +0x1bc
main.main()
        /home/24G/go/src/github.com/alyyousuf7/twenty48/cmd/twenty48/main.go:28 +0x58
 ><>  ~ > go env                                                                      
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/[user]/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/[user]/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build611790322=/tmp/go-build -gno-record-gcc-switches"

Hopefully that's enough info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.