add makefile, shuffle properly, more card fixes

This commit is contained in:
stryan 2021-07-16 14:08:19 -04:00
parent b37cc0e73c
commit 8062c99ee6
2 changed files with 28 additions and 0 deletions

19
Makefile Normal file
View File

@ -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

View File

@ -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)
}