summaryrefslogtreecommitdiff
path: root/doc/codewalk/pig.go
diff options
context:
space:
mode:
Diffstat (limited to 'doc/codewalk/pig.go')
-rw-r--r--doc/codewalk/pig.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/doc/codewalk/pig.go b/doc/codewalk/pig.go
index 9e415f589..10963b4e4 100644
--- a/doc/codewalk/pig.go
+++ b/doc/codewalk/pig.go
@@ -6,7 +6,7 @@ package main
import (
"fmt"
- "rand"
+ "math/rand"
)
const (
@@ -61,9 +61,6 @@ func play(strategy0, strategy1 strategy) int {
currentPlayer := rand.Intn(2) // Randomly decide who plays first
for s.player+s.thisTurn < win {
action := strategies[currentPlayer](s)
- if action != roll && action != stay {
- panic(fmt.Sprintf("Player %d is cheating", currentPlayer))
- }
s, turnIsOver = action(s)
if turnIsOver {
currentPlayer = (currentPlayer + 1) % 2