Project Setup
Part of the Logic & Flow section of Coddy's Lua journey — lesson 41 of 54.
Challenge
EasyOver the next several lessons, you'll create a program that can store, display, search, and manage contact information.
Create the foundation for your contact list application by setting up the main data structure and displaying the user interface.
Initialize an empty list-style table called contacts that will store all contact information. Then display a welcome message and a menu showing the available commands.
Requirements:
- Create an empty table named
contacts - Print the message:
Welcome to Contact List Manager! - Print a blank line
- Print the menu header:
Available Commands: - Print each menu option on a separate line:
add - Add a new contactlist - Display all contactssearch - Search for a contactdelete - Delete a contactquit - Exit the program
Expected Output:
Welcome to Contact List Manager!
Available Commands:
add - Add a new contact
list - Display all contacts
search - Search for a contact
delete - Delete a contact
quit - Exit the programTry it yourself
All lessons in Logic & Flow
1Advanced Table Iteration
Iterating with pairs()Iterating with ipairs()pairs() vs. ipairs()Recap - Character Sheet2More Table Library Functions
table.concat()table construction & unpack()table.sort()Custom Sorting with FunctionsRecap - High Score Board5Project: Text Adventure Engine
Project Setup: The RoomLinking Rooms8Project: Contact List
Project SetupThe Main Loop