Overview
Bulls and Cows -- also known as Cows and Bulls or Pigs and Bulls or Bulls and Cleots -- is an old code-breaking paper and pencil game for two players, similar to Mastermind.
It is a game with numbers that may date back a century or more. It is played by two opponents. The game can also be played with 3 digits instead of 4. 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".)
- Create a program that can guess a 4 digit secret code composed any of the numbers 0 - 9.
- The program must accept a bull feedback and a cow feedback.
- The program will continue to guess the 4 digit secret code which can be based on the given feedback on previous attempts until the code is guessed.
- The program must stop when the code has been revealed.
- There will only be 1 secret code that will be randomly generated manually or by a computer program.
- The secret code shall be a 4 digit combination composed of any of the numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.
- The secret code combination can be a repetition of the digit.
- The computer program shall attempt to break or guess the secret code by generating 4 digit numbers.
- The computer program shall accept 2 inputs for feedback, 1 for "Bulls" and 1 for "Cows". The feedback will be used to determine the next 4 digit numbers to generate for the next attempt.
- If a matching digit is on the right position it is considered a "Bull", if on a different position it's a "Cow".
- The computer program shall continue to break the code until the secret number is guessed. There will be no limit on the number of attempts.
- The computer program shall indicate that it has guessed the secret code.
- All teams must be registered before joining the programing competition.
- This will be a test of analytical skills and algorithm so the team can use any programming language of their choice.
- The team must provide their own laptop, PC, tablet or iPad to run their program.
- The teams should check-in their devices and should be in good running condition 1 hour before the start of the competition.
- The programming competition shall have 2 categories - Student and Professional.
- Individuals or a team of maximum of 3 members can join the competition.
- Participants can use any programming language of their choice.
- Two teams will play in best of 3 match.
- Each team will have a chance to compete with all other teams in a round robin tournament match belonging to the same category.
- The team which has the most number of wins shall be declared champion for that category.