When you guys are making a game with user input (i.e., using the Input or Prompt commands), how important is user input validation? Do you think it is worth the extra memory needed to implement it? The reason I'm asking is because I'm (slowly) putting together a validation tutorial to cover the main variable types that are inputted in games: numbers, strings, and lists.
I'm at the stage now where I'm trying to think of all of the different things that people should consider checking for when using those different variables, and I was wondering if you guys had any suggestions or ideas? These are the validation "rules" that I have come up with so far:
- Numbers
- Number is not a complex number
- Number is within the appropriate range
- Number is an integer (no fraction part)
- Number is positive (or zero)
- Strings
- String only contains certain characters
- String length is within the appropriate range
- Lists
- List length is within the appropriate range
- Each list element passes the number validation