【代码】使用 else if

前言

关卡攻略

源代码

1
2
3
4
5
6
7
8
for i in 1 ... 2 {
moveForward()
if isOnClosedSwitch {
toggleSwitch()
} else if isOnGem {
collectGem()
}
}

完成