From a669fa62dab58db4ea3f043dcf590e806ef3e2c3 Mon Sep 17 00:00:00 2001 From: TheLittleBoy Date: Sun, 29 Jun 2014 22:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BC=96=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码错误批量修正。 --- source/chapter2/21_Protocols.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/chapter2/21_Protocols.md b/source/chapter2/21_Protocols.md index e1173fce..5a5042c8 100755 --- a/source/chapter2/21_Protocols.md +++ b/source/chapter2/21_Protocols.md @@ -289,13 +289,13 @@ protocol DiceGameDelegate { ```swift class SnakesAndLadders: DiceGame { let finalSquare = 25 - let dic = Dice(sides: 6, generator: LinearCongruentialGenerator()) + let dice = Dice(sides: 6, generator: LinearCongruentialGenerator()) var square = 0 var board: Int[] init() { board = Int[](count: finalSquare + 1, repeatedValue: 0) - board[03] = +08; board[06] = +11; borad[09] = +09; board[10] = +02 - borad[14] = -10; board[19] = -11; borad[22] = -02; board[24] = -08 + board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02 + board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08 } var delegate: DiceGameDelegate? func play() { @@ -314,7 +314,7 @@ class SnakesAndLadders: DiceGame { square += board[square] } } - delegate?.gameDIdEnd(self) + delegate?.gameDidEnd(self) } } ```