def play(low, high, turns=1)
  num = (low + high) / 2
  print 
  case is_it?(num)
  when 1
    puts 
    play(low, num - 1, turns + 1)
  when -1
    puts 
    play(num + 1, high, turns + 1)
  else
    puts 
  end
end

def is_it?(num)
  num <=> $number
end

low, high = 1, 100
$number = rand(low .. high)

puts 
play(low, high)