Minor code style improvements

Tabs are corrected, semantic blocks are separated.
This commit is contained in:
nyapsilon 2021-04-09 21:24:04 +03:00 committed by GitHub
parent 4fa7e1a672
commit e6b674275e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,13 +13,16 @@ else
front = middle + 1 front = middle + 1
end end
end end
nil nil
end end
puts "Enter a sorted space-separated list:" puts "Enter a sorted space-separated list:"
arr = gets.chomp.split(' ').map(&:to_i) arr = gets.chomp.split(' ').map(&:to_i)
puts "Enter the value to be searched:" puts "Enter the value to be searched:"
value = gets.chomp.to_i value = gets.chomp.to_i
puts if binary_search(arr, value) != nil puts if binary_search(arr, value) != nil
"Found at index #{binary_search(arr, value)}" "Found at index #{binary_search(arr, value)}"
else else