Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rlbisbe
Created September 27, 2015 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlbisbe/a845815ffaf919feba3e to your computer and use it in GitHub Desktop.
Save rlbisbe/a845815ffaf919feba3e to your computer and use it in GitHub Desktop.
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