スーパーpre記法のテスト
#!/usr/bin/ruby -Ku def binary_search(array, value, head=0, tail=array.length) if (head > tail) return -1 end where = ((head + tail) / 2).truncate if (value == array[where]) return where end if (value < array[where]) tail = where-1 else head = where+1 end return binary_search(array, value, head, tail) end puts binary_search((1..100).to_a, 30)