So I've been making a small game in Python named Cows and Bulls. For those who don't know it's very simple. 1 player generates a number the other tries to guess. If the guess has a number on the correct position it gives you a cow. If it has a number but on the wrong position it gives you a bull, so until the cow value isn't 4 (4 digit number) the game keeps going. It keeps giving hints until the number is guessed.
I've actually sucessfully created the player part of the program. Now I moved on to creating an AI. I generate a number, and the PC tries to guess that number.
My problem is the conditions to help the PC find this number. Right now I have the basic ones. If the PC guess finds no bulls and no cows, it discards all those numbers for the next guesses, if it finds all bulls is tries every combination of with those 4 numbers and of course the normal winning conditions.
The PC takes a long time to guess it though. There aren't enough conditions that facilitate the process of guessing the number. 
So I was wondering if anyone can give me some tips on what conditions I can put onto my program to facilitate him guessing the right number? I've been thinking about it but been struggling with it. Can't seem to find a good condition that actually helps considerably the time the PC takes to guess.
In any way thanks in advance!
I would use the process of elimination. Start off with a set of all 4 digit numbers from 1000 to 9999. 
Then if you give the computer a cow, so the computer knows it is of the form _ _ 3 _. Remove all numbers that are not of that form from the set.
If you give the computer a bull, say for the number 4. Remove all 4 digit numbers that don't have a 4 in them somewhere.
For the computers next turn, just pick a random number from the set of numbers that it now knows are still potential values.
Also, if you don't get a bull or a cow from a number, you can remove all numbers that include the digits for the numbers you didn't get a bull or cow for.
Then repeat.
You'll whittle down the potential numbers pretty quickly. Then the computer will either guess the correct number or there will only be one left.
I hope this helps :)
Cows and Bulls PC Guessing