This piece of code is similar to machine learning. But instead of learning, it corrects itself to get a better answer. Slow mode slo-mo the code to see it an action better. The Dark green dots are the code's guessing range The Blue dots are the set range and bounds of the target number, it's like a clue for the code. The Light green dot is the code's guessing number. The red dot is the code's target.
The Code is pretty simple, One part just guesses the number with a Random Number Generator (RNG) and another part slims or widen the range of the RNG. It will widen the range if the guessed number is out of range and slims it down if the guessed number is in range. This took me hours to figure the slim and widen part.