Update 06_Functions.md

应更正为 >, 否则会死循环
This commit is contained in:
zhang3xing1
2015-05-13 16:03:54 +08:00
parent 9261664925
commit 8c1d166532

View File

@ -562,7 +562,7 @@ func chooseStepFunction(backwards: Bool) -> (Int) -> Int {
return backwards ? stepBackward : stepForward return backwards ? stepBackward : stepForward
} }
var currentValue = -4 var currentValue = -4
let moveNearerToZero = chooseStepFunction(currentValue < 0) let moveNearerToZero = chooseStepFunction(currentValue > 0)
// moveNearerToZero now refers to the nested stepForward() function // moveNearerToZero now refers to the nested stepForward() function
while currentValue != 0 { while currentValue != 0 {
println("\(currentValue)... ") println("\(currentValue)... ")