Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
5
Task/Loops-Do-while/Scala/loops-do-while-3.scala
Normal file
5
Task/Loops-Do-while/Scala/loops-do-while-3.scala
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def loop(i: Int, cond: (Int) => Boolean): Stream[Int] = {
|
||||
val succ = i + 1;
|
||||
succ #:: (if (cond(succ)) loop(succ, cond) else Stream.empty)
|
||||
}
|
||||
loop(0, (_ % 6 != 0)).foreach(println(_))
|
||||
Loading…
Add table
Add a link
Reference in a new issue