I would like to know what is the best solution to create simple menu with functionality described below (pseudo code) just like I’m used to:
while (true) {
x = readLine();
case (x):
x == "1" then do sth1 function
x == "2" then do sth2 function
}
Or maybe any other ideas on how to make a menu not in the pattern described above?
Something like
You could probably split the enumerating in “choices” so you only have the descriptions and functions inside it, a little bit of separation, but this works. Evaluating the “menu” function will let you choose what to do!