Cody

# Problem 2635. Higher! Lower!

Solution 3807523

Submitted on 23 Nov 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail

Unrecognized function or variable 'low_bound'. Error in high_or_low (line 7) trail = [trail,floor((trail(length(trail))+low_bound)/2)];

2   Fail
hi_bound=1024; lo_bound=1; right_answer=513; assert(isequal(high_or_low(lo_bound,hi_bound,right_answer), [512 768 640 576 544 528 520 516 514 513]))

Unrecognized function or variable 'low_bound'. Error in high_or_low (line 7) trail = [trail,floor((trail(length(trail))+low_bound)/2)];

3   Fail

Unrecognized function or variable 'low_bound'. Error in high_or_low (line 7) trail = [trail,floor((trail(length(trail))+low_bound)/2)];

4   Fail
hi_bound=1024; lo_bound=1; right_answer=1024; assert(isequal(high_or_low(lo_bound,hi_bound,right_answer), [512 768 896 960 992 1008 1016 1020 1022 1023 1024]))

Unrecognized function or variable 'low_bound'. Error in high_or_low (line 7) trail = [trail,floor((trail(length(trail))+low_bound)/2)];

5   Fail
hi_bound=2048; lo_bound=0; right_answer=0; assert(isequal(high_or_low(lo_bound,hi_bound,right_answer), [1024 512 256 128 64 32 16 8 4 2 1 0]))

Unrecognized function or variable 'low_bound'. Error in high_or_low (line 7) trail = [trail,floor((trail(length(trail))+low_bound)/2)];

6   Fail
hi_bound=65535; lo_bound=0; right_answer=1024; assert(isequal(high_or_low(lo_bound,hi_bound,right_answer), [32767 16383 8191 4095 2047 1023 1535 1279 1151 1087 1055 1039 1031 1027 1025 1024]))

Unrecognized function or variable 'low_bound'. Error in high_or_low (line 7) trail = [trail,floor((trail(length(trail))+low_bound)/2)];

7   Fail