mirror of
https://github.com/golang/go.git
synced 2025-11-10 21:51:05 +00:00
doc/codewalk/functions.xml: Fix broken function examples
I removed the broken function comparison example and fixed a code highlighting regexp. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5501078
This commit is contained in:
parent
a274798d6e
commit
c2b87ce007
2 changed files with 1 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue