From 8062c99ee63994702e612ff96ac0ee3161851404 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 16 Jul 2021 14:08:19 -0400 Subject: [PATCH] add makefile, shuffle properly, more card fixes --- Makefile | 19 +++++++++++++++++++ main.go | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..900f647 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +GOFILES=$(wildcard *.go) +PROG=snengame +#set variables +GIT_COMMIT := $(shell git rev-list -1 HEAD) +ifeq ($(PREFIX),) # PREFIX is environment variable, but if it is not set, then set default value + PREFIX := /usr/local +endif + +$(PROG): $(GOFILES) + go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)" + +clean: + rm -f snengame +run: snengame + ./snengame +install: $(SNENGAME) + install -d $(DESTDIR)$(PREFIX)/bin + install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin + diff --git a/main.go b/main.go index 7905807..0c24ea2 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,14 @@ package main +import "fmt" + func main() { + g := NewGame() + + fmt.Println(g.GameBoard) + g.PlayerStateAct(1, "b") + g.PlayerStateAct(1, "s") + scry := g.PlayerAct(1, "s") + fmt.Println(scry) }