I've been playing a game similar to Bulls and Cows, but it goes like this: one player has to pick a random $4$ digit number. Digits can repeat, any digit between $0$ to $9$ and, you only get the number of digits on correct positions on each guess and you have to guess it in as few tries as you can.
Let's say the number is: $3301$, if I say $3209$ then I get $2$, meaning I've got $2$ positions correct.
I'm trying to find an algorithm that can find the number in maximum $10$-$12$ tries. Until now I have found one that can guess between $6$ and $25$ guesses. You pick random $4$-digit numbers until you find a number with $0$ correct positions, use its digits to permute when you find another number, this time with at least one correct guess. For each digit of this last number, it is used in combination with the ones that aren't correct, and if you get the one, meaning that the digit you picked along with the incorrect ones, is indeed correct and you can add it to the final number. It goes like this until you have the full number.