↧
Answer by chrylis -cautiouslyoptimistic- for Flexible switch case syntax
It's typically preferable to use a lookup table and polymorphism instead of a conditional (if or switch) when practical. It's particularly helpful in a case like this, where your different commands are...
View ArticleAnswer by nhouser9 for Flexible switch case syntax
You could use .split("") on the input string to split it into an array of strings where each element in the array was a word in your original string. In other words"ADD C She".split("") = {"ADD", "C",...
View ArticleFlexible switch case syntax
My entire program is similar to that of command prompt. Currently, I'm writing a function that appends a word entered by a user to a particular file. The user must follow appropriate syntax. By typing...
View Article