MCPcopy
hub / github.com/inancgumus/learngo / announce

Function announce

x-tba/tictactoe-experiments/06-refactor/main.go:72–86  ·  view source on GitHub ↗
(g *game, st state)

Source from the content-addressed store, hash-verified

70}
71
72func announce(g *game, st state) {
73 red := c.New(c.FgRed, c.Bold)
74 green := c.New(c.BgBlack, c.FgGreen, c.Bold)
75
76 switch st {
77 case stateAlreadyPlayed, stateWrongPosition:
78 red.Printf("\n>>> You can't play there!\n")
79 case stateWon:
80 g.print()
81 green.Printf("\nWINNER: %s\n", g.player)
82 case stateTie:
83 g.print()
84 green.Printf("\nTIE!\n")
85 }
86}
87
88func selectSkin(in *bufio.Scanner) skin {
89 fmt.Println(c.MagentaString("Our finest selection of skins:"))

Callers 1

mainFunction · 0.85

Calls 2

PrintfMethod · 0.80
printMethod · 0.65

Tested by

no test coverage detected