Created
June 3, 2016 00:23
-
-
Save anonymous/4ec7ef9facb8fe93cb9526b44ede6c5d to your computer and use it in GitHub Desktop.
Scala Kata shared content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.scalakata._ | |
| @instrument class Playground { | |
| object Math { | |
| def add(ints:Array[Int]): Int = { | |
| var sum = 0 | |
| var i=0 | |
| while(i < ints.length){ | |
| sum += ints(i) | |
| i += 1 | |
| } | |
| return sum | |
| } | |
| } | |
| println(Math.add(1 to 10000 toArray)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment