Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.27 KB | None | 0 0
  1.   def getUserInput(message: String, failConditions: (String => Boolean)*) = {
  2.     var input = ""
  3.     do {
  4.       println(message)
  5.       input = scala.io.StdIn.readLine.trim
  6.     } while ( (for (f <- failConditions; if f(input)) yield true).contains(true) )
  7.     input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement