Skip to content

gucio321/tic-tac-go

Repository files navigation

CircleCI Go Report Card GoDoc codecov

Tic-Tac-Go

is an implementation of the tic-tac-toe game written in Golang In addition it implements a relatively simple AI logic for PC players. For more details see here

Installation

standard installation

Requirements

to run the game you just need to have GO programming language installed.

You may also want to use graphical version of the game, so I suggest following GIU installation instruction

Installing binaries

To install the game with golang api, first download it: go get github.com/gucio321/tic-tac-go and let's GO! Since now, an executable will be present in $GOPATH/bin/ directory.

So how to run now?

After installation, just run go run github.com/gucio321/tic-tac-go/cmd/terminal-game for simple console game implementation or go run github.com/gucio321/tic-tac-go/cmd/giu-game for advanced graphical one.

Well, but I'd like to know more about source code!

You can also download the source by running git clone https://github.com/gucio321/tic-tac-go and then, to set up the project:

cd tic-tac-go
go get -d ./...

Docker installation

Since v3, I support Docker to build and run the game.

plain docker

images are available on quay.io

Note, that you need to add the following options to correctly run the container:

docker run \
    -d
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix/:/tmp/.X11-unix/ \
    --security-opt label=type:container_runtime_t \
    quay.io/gucio321/tic-tac-go:latest

docker compose

you can use docker-compose to skip the above commands:

docker-compose up -d

Screenshots

tic tac go in terminal

tic tac go with DearImgui using GIU

Motivation

When I'm learning a new programming language, I write a game like this one to check myself. Because I liked golang and decided to share and improve my work.