summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon C. Irizarry <brandon.irizarry@gmail.com>2026-04-23 16:22:50 -0400
committerBrandon C. Irizarry <brandon.irizarry@gmail.com>2026-04-23 16:22:50 -0400
commit074822f39b26f648ace24cd105f15c4377e1007a (patch)
tree80a825e034cecdb1598360217263c103b3ffd817
parentb893962cc7daa1ec30fbfb721d900d53514142f4 (diff)
feat: include some logging
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index d6e70f6..f561be4 100644
--- a/main.go
+++ b/main.go
@@ -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}
}