Display Menu
Part of the Logic & Flow section of Coddy's GDScript journey. Lesson 24 of 78.
Challenge
EasyIn this project you build a Contact Book: a program that adds, shows, edits, deletes and lists contacts. Each contact has a name, a phone number, an email and an address. You will write it step by step, with one function per menu option.
Start with the menu. Write a function display_menu() below _ready() that prints these seven lines:
Contact Book Menu:
1. Add Contact
2. View Contact
3. Edit Contact
4. Delete Contact
5. List All Contacts
6. Exit_ready() already calls display_menu(), so the program prints the menu once.
Try it yourself
extends Node
func _ready():
display_menu()
func display_menu():
# Print the menu here
pass
All lessons in Logic & Flow
1Strings In Depth
String MethodsSearching in StringsReplace and TrimSplit and JoinRecap - Username Check4Dictionaries Part 2
Nested DictionariesArrays of DictionariesMerging DictionariesCopying DictionariesRecap - Frequency Counter2Advanced Decision Making
Match With VariablesMatch GuardsArray PatternsDictionary PatternsMembership ChecksRecap - Command Parser5Contact Book Application
Display MenuAdd Contact8Student Records Manager
Project OverviewAdd Student3Multi-dimensional Arrays
2D Arrays BasicsAccessing 2D Array ElementsNested Loops with 2D ArraysRecap - 2D ArraysJagged ArraysCommon 2D Array PatternsRecap - Game Board6Sets with Dictionaries
What is a Set?Dictionary as a SetAdding and RemovingUnion and IntersectionSet DifferenceRecap - Remove Duplicates9Advanced Data Aggregation
Summing ValuesFinding Minimum and MaximumCustom SortingRecap - Dictionary SorterPractice on your own: Online GDScript compiler