【笔记】SwiftPlaygrounds学习笔记
前言
Swift Playgrounds is an educational tool and development environment for the Swift programming language developed by Apple Inc., initially announced at the WWDC 2016 conference.(维基百科)
学习编程1
执行函数
<name>:函数名
1 | <name>() |
创建函数
1 | func <name>() { |
for循环
- 从1开始循环
<num>:循环的次数
1 | for i in 1 ... <num> { |
if判断
<boolean>:一个函数返回的布尔值
1 | if <boolean> { |
逻辑运算符
- 与
&& - 或
|| - 非
!
while循环
1 | while <boolean> { |