Guest User

Untitled

a guest
Jan 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. for (int i=1;i<100000;i=2*i)
  2.  
  3. def loopByTwiceBefore(from:Int, to:Int)(f:Int=>Unit):Unit = {
  4. if (from<to){
  5. f(from)
  6. loopByTwiceBefore(from*2, to)(f);
  7. }
  8. }
  9.  
  10. Iterator.iterate(1)(_*2).takeWhile(_ < 100000) foreach {...}
Add Comment
Please, Sign In to add comment