Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getUserInput(message: String, failConditions: (String => Boolean)*) = {
- var input = ""
- do {
- println(message)
- input = scala.io.StdIn.readLine.trim
- } while ( (for (f <- failConditions; if f(input)) yield true).contains(true) )
- input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement