Created
September 27, 2015 06:18
-
-
Save rlbisbe/a845815ffaf919feba3e to your computer and use it in GitHub Desktop.
This file contains 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
def main(args: Array[String]){ | |
test(-1, 2, Array.emptyIntArray) | |
test(0, 1, Array(1,2,3,4,5)) | |
test(2, 3, Array(1,2,3,4,5)) | |
test(2, 3, Array(1,2,3)) | |
test(0, 1, Array(1)) | |
test(4, 5, Array(1,2,3,4,5)) | |
test(3, 4, Array(1,2,3,4,5)) | |
test(1, 2, Array(1,2,3,4,5)) | |
test(-1, 0, Array(1,2,3,4,5)) | |
test(-1, 7, Array(1,2,3,4,5)) | |
} | |
def test(expected: Int, target: Int, searchBox: Array[Int]): Unit ={ | |
assert(expected, chop(target, searchBox)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment