This repo creates the well known werewolves game using Go Programming language. The program is architectured around using Actor model for defining the server and client programs. The communication mode is using gRPC which supports bidirectional streaming for RPCs.
wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
to remove any existing installationssudo tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz
to extract contents to local user path in Linux.export PATH=$PATH:/usr/local/go/bin
go version
(If the go version gets listed, your installation worked fine)git clone https://github.com/codlocker/werewolves-go.git
Ensure you are in the werewolf code repo (Run cd werewolves-go/
)
Run make build
The client and server builds are created in the /bin/ folder.
Clean existing builds by running make clean
(if required).
cd bin/
./server
cd bin/
./client -username=<username>
./client username=a
./client username=b
./client username=c
./client username=d
POSSIBLE ERRORS
Go package missing or go.mod errors
go mod tidy
In case the above steps fail, you can directly run the code as follows
Server code:
cd server/
go run main.go
Client code:
cd client/
go run main.go