廖德 Handel Working Spece
free your mind be Happy then do a good job ! 「讓硬體開口說話,讓軟體腳步前行,讓Robot聽你的指令奔馳!」
welcom ! Handel home
2014年7月10日 星期四
swift aobut for and while
for
var index =
0
; index <
9
; index++ {
println(
"拍照一次!"
)
println(
"存檔!"
)
}
for
x
in
1
...
10
{
println(
"拍照第\(x)次!"
)
println(
"存檔!"
)
}
for
x
in
1
...
10
{
if
(x ==
5
)
{
println(
"show \(x) times!"
)
break
;
}
println(
"show this \(x) !"
)
}
for
x
in
1
...
10
{
if
(x %
2
==
0
)
{
continue
;
}
println(
"show \(x) times!"
)
}
var total=
0
var count=
0
while
total <
100
{
if
(count>
15
)
{
break
}
count=count+
1
let x:Int = (Int)(arc4random() %
10
)
println(
"show all = \(total) !"
)
total = total+x
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言