- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoop.lua
More file actions
Latest commit
43 lines (39 loc) · 429 Bytes
/
Copy pathLoop.lua
File metadata and controls
43 lines (39 loc) · 429 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--while
--for
--repeat until(do while)
---while循环
--[[
a=1
while a<=20 do
if a%2==1 then
print(a)
end
a=a+1
end
--]]
---for循环
--[[
--数值
for i=0,10,3 do
print(i)
end
--泛型
tab={k1=1,k2=2,k3=3}
for k,v in pairs(tab) do
print(k,v)
end
--]]
---repeat循环
--[[
a=1
repeat
print(a)
a=a+1
until(a>5)
--]]
---嵌套循环
fora=1,5,1do
forb=1,a,1do
print("值为"..a)
end
end