diff options
| author | Brandon C. Irizarry <brandon.irizarry@gmail.com> | 2026-04-23 16:22:50 -0400 |
|---|---|---|
| committer | Brandon C. Irizarry <brandon.irizarry@gmail.com> | 2026-04-23 16:22:50 -0400 |
| commit | 074822f39b26f648ace24cd105f15c4377e1007a (patch) | |
| tree | 80a825e034cecdb1598360217263c103b3ffd817 /main.go | |
| parent | b893962cc7daa1ec30fbfb721d900d53514142f4 (diff) | |
feat: include some logging
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -36,6 +36,7 @@ type Score struct { func game(numPlayers, faces int) { // Get the game's winning number by throwing the die once. winningNumber := throwDie(faces) + fmt.Printf("Winning number is %d\n", winningNumber) // The scores channel communicates the number of turns a // player took to hit the winning number. @@ -53,6 +54,8 @@ func game(numPlayers, faces int) { for { score++ outcome := throwDie(faces) + fmt.Printf("Player %d threw a %d\n", id, outcome) + if outcome == winningNumber { scores <- Score{id: id, score: score} } |
