Brute Force Password Cracker
It's not guessing correctly.
Your program is trying to guess a single char in the password, then moves on and does the same process with the next char in the password.
Password crackers don't work like that. It's not supposed to guess each individual char in the password, it's supposed to keep trying until the program cracks the entire password.
For example, if my password is "awesome", how is a password cracker supposed to know that the first letter of my password is an 'a' if it still doesn't know the rest of the password?