https://scratch.mit.edu/projects/1196350080
PLAIN ENGLISH/PSEUDOCODE
Found switch set to false
Left pointer set to 0
right pointer set to listlength-1
SEARCHITEM <-- INPUT
WHILE not found and left point is less than or equal to right
SET mid point to list length DIV 2
IF midpoint is equal to SEARCHITEM
THEN set foudn to TRUE
ELSE IF SEARCHITEM is > midpoint
THEN set left pointer to midpoint +1
ELSEIF SEARCHITEM is < midpoint
THEN set rightpoint to midpoint -1
Problem code isnt working when value is more than the mid pointer value, can you fix it?
Operator precedence problem, the integer division is being calculated before the pointer addition.