ramu said:
Hi,
can anyone please give me an algorithm to implement cows and
bulls game in c?
I have discovered that "Bulls and Cows", which I'd never heard of, is a
game rather like Mastermind.
Algorithms are language-neutral, so they're not really relevant here,
and in any case I suspect that your tutor wants you to work this out
for yourself. But here's a hint: there are finitely many possibilities
for each position. Your task is to find the way of generating the guess
that will eliminate as many of them as possible at a single step. Note
that you start with four digits, each of which can be 0 to 9. For your
first guess, I recommend that you choose a random number with all four
of its digits different.
You may get more hints if you ask in a more relevant newsgroup, such as
comp.programming, but nobody will do your homework for you.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.