Go-boardgame is a simple Go package that can be used as the scaffolding to write the game logic for any board or turn based game.
This package is now stable with new features in the works.
go get github.com/quibbble/go-boardgame
Go-boardgame also contains a number of helpful packages that can be optionally used to speed up development:
- bgerr adds helpful error statuses and messages to board games.
- bgn adds a standardized machine-readable notation to board games for easy storage and game recreation.
- collection adds logic that can be used for decks, hands, etc. This package makes use of Go generics so that it can be used with any of your custom types.
Tic-Tac-Toe provides a simple example implementation.
You can also view all currently implemented games here.
Additional resources common to many games will be added to the above packages list as time goes on to make writing the logic for these games a far faster process. Any ideas or PRs to improve or add additional features are always welcome.