Thread: Bulls & Cows - C Program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    108

    Bulls & Cows - C Program

    Hey everyone,

    I need help understanding the exercise I have and if possible to give me steps on how to figure it out.

    I need to build a Bulls & Cows program.

    Small Explanation of Bulls and Cows:
    The numerical version of the game is usually played with 4 digits, but can also be played with 3 or any other number of digits.
    On a sheet of paper, the players each write a 4-digit secret number. The digits must be all different. Then, in turn, the players try to guess their opponent's number who gives the number of matches. If the matching digits are on their right positions, they are "bulls", if on different positions, they are "cows". Example:

    • Secret number: 4271
    • Opponent's try: 1234
    • Answer: 1 bull and 2 cows. (The bull is "2", the cows are "4" and "1".)

    The first one to reveal the other's secret number wins the game. As the "first one to try" has a logical advantage, on every game the "first" player changes. In some places, the winner of the previous game will play "second". Sometimes, if the "first" player finds the number, the "second" has one more move to make and if he also succeeds, the result is even.
    The secret numbers for bulls and cows are usually 4-digit-numbers, but the game can be played with 3 to 6 digit numbers (in every case it is more difficult than with 4).

    Unfortunately i have different instructions that this one that i'll post after I understand the steps that I need to do and actually code the normal game.

    Can someone give me a step to step guide on what to start with?
    I'm in my first year program so i might not be very precise on what i'm asking.

    Please let me know if you need more information about what i'm asking.

    All help appreciated

    Last edited by YannB; 12-10-2013 at 05:31 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My first major program- Bulls and cows Game
    By Suhasa010 in forum C Programming
    Replies: 7
    Last Post: 09-06-2013, 04:34 AM
  2. Replies: 2
    Last Post: 12-11-2012, 12:25 AM
  3. Help needed in cows and bulls
    By Nikolas in forum C Programming
    Replies: 14
    Last Post: 01-13-2012, 07:06 PM
  4. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  5. Replies: 5
    Last Post: 08-16-2007, 11:43 PM