daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 {...}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top