473,320 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

cows and bulls

Hi,
can anyone please give me an algorithm to implement cows and
bulls game in c?

regards

Feb 14 '07 #1
1 4122
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.
Feb 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Harlan Messinger | last post by:
Are files referenced in LONGDESC attributes supposed to be pure text; can or should they have either block or inline HTML tags; can or should they be set up as a fully W3C compliant web page (with...
104
by: Colin McGuire | last post by:
Hi, is there a way to show a form without a titlebar (and therefore no control box/minimize box/title etc) but still have it appear looking like 3D? The property FormBorderStyle to None - this...
2
by: Sai | last post by:
Hi All, I have written a HTTP Module (Auth.dll) to authenticate pages in a virtual directory. The virtual directory points to a network path (per se \\net1\web). Now I have to place the...
7
by: Sam Kong | last post by:
Hello! My question would not be very practical but just out of curiosity. In JavaScript, Array is a subclass of Object. Well maybe not exactly... but sort of... For normal objects, you can...
852
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
0
by: =?Utf-8?B?amRzdGVudG8=?= | last post by:
(I apologize if this is a repeat. I was told to post under the managed news group. I'm a little confused, but...) I'm running SRS 2000 with SP2 and I'm using IE 6.0 with SP2 (and IE 7.0) to...
2
by: ramu | last post by:
Hi, can anyone please give me an algorithm to implement cows and bulls game which takes minimum number of passes to guess the 4 digit number? regards
1
by: Rajtomar | last post by:
i have small gaem which pick a word randomly from a list of 100 four letterd words and asks user to guess it, when user inputs it, program compares the inputted word with the randomly picked word...
4
by: bwrobo | last post by:
OK, I've searched through Google with a mass headache of complicated answers to what I consider a simple problem, that I just cannot get the logic to work out. I am creating a program where I need...
20
by: cowboyrocks2009 | last post by:
Hi, I need help to automate my code to take data from input file. Also I need to create it as a function so that I can pass it to some other program. I am new to Java so having a bit limitation to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.