diff options
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} } |
