Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Conditional-structures/Lua/conditional-structures.lua
Normal file
32
Task/Conditional-structures/Lua/conditional-structures.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
--if-then-elseif-then-else
|
||||
if a then
|
||||
b()
|
||||
elseif c then
|
||||
d()
|
||||
else
|
||||
e()
|
||||
end
|
||||
|
||||
for var = start, _end, step do --note: end is a reserved word
|
||||
something()
|
||||
end
|
||||
|
||||
for var, var2, etc in iteratorfunction do
|
||||
something()
|
||||
end
|
||||
|
||||
while somethingistrue() do
|
||||
something()
|
||||
end
|
||||
|
||||
repeat
|
||||
something()
|
||||
until somethingistrue()
|
||||
|
||||
cases = {
|
||||
key1 = dothis,
|
||||
key2 = dothat,
|
||||
key3 = dotheother
|
||||
}
|
||||
|
||||
cases[key]() --equivalent to dothis(), dothat(), or dotheother() respectively
|
||||
Loading…
Add table
Add a link
Reference in a new issue