Help for this page

Select Code to Download


  1. or download this
    use List::BinarySearch 'binsearch';
    use IO::Prompt::Hooked 'prompt';
    ...
      exit(0);
    
    } undef, @{[1 .. 10]};
    
  2. or download this
    Please think of a number between 1 and 10...
    DON'T tell me, just let me guess it!
    ...
    Is the number 8? (higher, lower, or yes):  lower
    Is the number 7? (higher, lower, or yes):  yes
    Found 7 in 3 guesses.