Session 16
Source Code
print("Session 16")
-- define main function
function main()
print("Main Function")
local done = false
local choice = nil
while not done do
print("Menu")
print("E1 - Example 1")
print("Q - Quit")
io.write("Choice: ")
choice = io.read()
if choice == "E1" then
print("Example 1")
-- call Example 1 Function
elseif choice == "E2" then
print("Example 2")
-- call Example 1 Function twice
elseif choice == "E3" then
print("Example 3")
-- call Example 3 Function
elseif choice == "E4" then
print("Example 4")
-- call Example 4 Function
elseif choice == "E5" then
print("Example 5")
-- call Example 5 Function
elseif choice == "E6" then
print("Example 6")
-- call Example 6 Function
elseif choice == "E7" then
print("Example 7)
-- call Example 7 Function
elseif choice == "E8" then
print("Example 8")
-- call Example 8 Function
elseif choice == "Q" then
done = true
else
print("Invalid Choice")
end
end
end
-- define Example 1 Function
-- define Example 3 Function
-- define Example 4 Function
-- define Example 5 Function
-- define Example 6 Function
-- define Example 7 Function
-- define Example 8 Function
-- call main function, do not delete!
main()s16problem1.lua
s16problem2.lua
s16problem3.lua
s16problem4.lua
s16problem5.lua
s16problem6.lua
s16problem7.lua
s16problem8.lua
s16problem9.lua
Last updated
Was this helpful?