Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i=1;i<100000;i=2*i)
- def loopByTwiceBefore(from:Int, to:Int)(f:Int=>Unit):Unit = {
- if (from<to){
- f(from)
- loopByTwiceBefore(from*2, to)(f);
- }
- }
- Iterator.iterate(1)(_*2).takeWhile(_ < 100000) foreach {...}
Add Comment
Please, Sign In to add comment