I've made a simple way for a user to type in console to choose between a few options.
print("Y / N / SUBS / SCENES")
let chooseWisely = readLine()
switch chooseWisely{
case "Y","ye","yup","yes","y","YES","Yeah","yeya","YES!","Yes","Yup","Both","both":
print(Alrighty, doing both)
case "subs", "just subs", "only subs", "subs only", "Subs", "subywuby", "subway", "SUBS":
print("okay, just subs")
case "scenes", "Scenes", "shits", "sceneeruskies", "just scenes", "scenes only", "only scenes", "scenes fired", "scenes!", "SCENES", "gimmeh the scenes":
print("okay, just scenes")
case .some(_):
print("Alrighty then, not doing it.")
case .none:
print("Alrighty then, not doing it.")
}
As you can see the cases get quite unwieldy trying to cover a decent amount of possible user inputs, I would at least like to simplify it by making it case insensitive.
I'm also open to an entirely different approach of handling user input like this if I've gone down the wrong path from the get go.