Repeat Until loop in Scala