Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to display the menu
- local function displayMenu()
- print("Select an option:")
- print("1. Option 1")
- print("2. Option 2")
- print("3. Option 3")
- end
- -- Function to perform actions based on user input
- local function performAction(option)
- if option == "1" then
- print("You selected Option 1")
- -- Add code for Option 1 here
- elseif option == "2" then
- print("You selected Option 2")
- -- Add code for Option 2 here
- elseif option == "3" then
- print("You selected Option 3")
- -- Add code for Option 3 here
- else
- print("Invalid option. Please select 1, 2, or 3.")
- end
- end
- -- Main function to run the program
- local function main()
- displayMenu() -- Display the menu
- local option = read() -- Read user input
- performAction(option) -- Perform action based on user input
- end
- -- Run the program
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement