校正+翻译 From SketchK

主要内容
1 `控制流`章节中的`while循环`一节中的代码更新(废弃了++)
2 `控制流`章节中的`repeat-while循环`一节中的代码更新(废弃了++)
3 `控制流`章节中的`if`代码有误(原文中与当前翻译中数值不相符)
4 `函数`章节中`常量与变量参数`一节已经被废弃,进行了删除操作
5 `函数`章节中`输入与输出参数`一节内容进行更新(原文与当前翻译中的内容不相符)
6 `闭包`章节中`单表达式闭包隐式返回`一节内容翻译有误(原文与当前翻译中的内容不相符)
7 `闭包`章节中`运算符函数`一节内容翻译有误(原文与当前翻译中的内容不相符)
8 `闭包`章节中`尾随闭包`一节内容更新(废弃了var修饰符,原文与当前翻译中内容不符,)
This commit is contained in:
Sketchk
2016-05-12 20:50:37 +08:00
parent 24488696b5
commit 4976c25347
7 changed files with 30 additions and 53 deletions

View File

@ -14,7 +14,7 @@
> 2.2
> 翻译:[LinusLing](https://github.com/linusling)
> 校对:[]()
> 校对:[SketchK](https://github.com/SketchK) 2016-05-12
本页包含内容:
@ -150,7 +150,8 @@ var square = 0
var diceRoll = 0
while square < finalSquare {
// 掷骰子
if ++diceRoll == 7 { diceRoll = 1 }
diceRoll += 1
if diceRoll == 7 { diceRoll = 1 }
// 根据点数移动
square += diceRoll
if square < board.count {
@ -209,7 +210,8 @@ repeat {
// 顺着梯子爬上去或者顺着蛇滑下去
square += board[square]
// 掷骰子
if ++diceRoll == 7 { diceRoll = 1 }
diceRoll += 1
if diceRoll == 7 { diceRoll = 1 }
// 根据点数移动
square += diceRoll
} while square < finalSquare
@ -275,7 +277,7 @@ if temperatureInFahrenheit <= 32 {
实际上,最后的`else`语句是可选的:
```swift
temperatureInFahrenheit = 90
temperatureInFahrenheit = 72
if temperatureInFahrenheit <= 32 {
print("It's very cold. Consider wearing a scarf.")
} else if temperatureInFahrenheit >= 86 {