If the user enters the wrong kind of input in the promptt function, it will erase their entered text and lets the user try again, without starting a new line. It also provides a default value for a user: pressing enter will use the default value, or typing anything else will let the user enter their own value. Finally, I've included a function - promptYesNo - for answering simple yes/no questions in a similar way as promptt.
Spoiler
pastebin: pastebin get u5K7DCXi