A Number-Finding Algorithm, look inside to see how it works! How It works: 1. Every operation, it will choose the number exactly between the highest possible number, and the lowest possible number. This allows it to split its possible numbers in half each time it completes a operation, which allows it to eliminate possible numbers much faster than normal! 2. It will then decide whether your number is greater, or less than that. This is to decide which numbers to eliminate from its list of possibilities! 2a. If Greater, it will set the lowest possible number to that number. This is because it knows your number is greater than the current number, and thus any number less than this is impossible to be it! 2b. If less, it will set the greatest possible number to that number. This is because it knows your number is less than the current number, and thus any number greater than this is impossible to be it! 3. It then adds 1 to the operation, and repeats! This is to repeat the process until it reaches your number, it will record how many operations it takes, and repeat the process if it has not reached your number! If you want to see it in slow motion, put a wait block below the block where it adds 1 to the operations, as this will make it wait a given amount of time between operations! NOTE: If the operations go above 110, something is wrong, as it will always find the answer in 110 operations or less! Trouble-Shooting: -Use Just Numbers, nothing else. -Sometimes it doesn't get the right answer, but it seems to be right most of the time. With how the code is written, it has to be something to do with scratch doing something with your number, as it is coded to not stop doing operations until it has your exact number.
Aaron_Archive Note: This is my implementation of a binary search system.