Warships-LightGUI provides an easy to use graphical user interface
for the Warships Online
game.
This package is suggested for beginners. If you want a more sophisticated
GUI, please check out the Warships-GUI
package:
http://github.com/grupawp/warships-gui
go get github.com/grupawp/warships-lightgui/v2
To initialize the board use the New() method. NewConfig() will create a default configuration.
board := gui.New(gui.NewConfig())
board.Display()
To customize colours and characters used to indicate ships, misses, etc,
create and pass custom Config
.
cfg := NewConfig()
cfg.HitChar = '#'
cfg.HitColor = color.FgRed
cfg.BorderColor = color.BgRed
cfg.RulerTextColor = color.BgYellow
New(cfg)
board.Display()
https://pkg.go.dev/github.com/grupawp/warships-lightgui/v2