Members Login.
 

Please register HERE to be part of our Community
Contest of the Day.
 
Participate and Earn $$$.
Looking to Hire.
 
Earn By Posting
 
Participate in forum and Earn $$$.
  • Referrer Credit - BRL$ 100
  • Positive Rep Cr. - BRL$ 3
  • New Thread Cr.- BRL$ 3
  • Posting Cr. - BRL$ 3
  • Post size Credit
Full List of BRL$ Earnings
Sponsors.
 


C / C++ / C # Programming discussions related to C / C++ / C#

Reply
  #1 (permalink)  
Old 04-02-2008
Peon
 
Join Date: Apr 2008
Posts: 1
Rep Power: 0
oceanaut is on a distinguished road
BRL$: 118.26
Default The Game of Mastermind

HOW to develop a program that plays the game of Mastermind by C programming?

The Game of Mastermind
Mastermind is a simple code-breaking board game for two players, i.e., a codemaker and a
codebreaker, invented in 1970 by Mordecai Meirowitz.
The codemaker secretly creates a code consisting of four colors selected from the set
{red, white, green, blue, black, yellow}, with duplicates allowed. The codebreaker tries to
guess the colors as well as the positions of the colors in the secret code. For each guess that
the codebreaker makes, the codemaker provides feedback in the following form:
1. The number of “black hits”, indicating the number of colors that are correct and in the
correct position.
2. The number of “white hits”, indicating the number of colors that are correct but in the
wrong position.
For instance, suppose we use the digits 0, 1, 2, 3, 4 and 5 to form the code. If the secret code
created by the codemaker is 0123 and the guess by the codebreaker is 0011, the codemaker
should provide a feedback of one black hit (B = 1) and one white hit (W = 1). Once feedback
is received, another guess is made by the codebreaker. The players continue to alternate turns
until the codebreaker guesses correctly.

Your Task
Develop a program that plays the game of Mastermind.
The user should be given the options to play the roles of codemaker and codebreaker. A game
is complete when the codebreaker succeeds in determining the secret code created by the
codemaker. Once a game has been completed, the user should be prompted for new games.
More games should be played until the user chooses to end the game.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
game power leveling and game gold wwwzhudan News 3 3 Weeks Ago 08:17 AM
'Game Plan' pays off with $22.7 million (AP) brl_admin Top Storeis 0 09-30-2007 01:24 PM
Selling head-tail game script Jason Buy / Sell Advertisements Board 0 07-23-2007 01:42 PM
game power leveling and game gold wwwzhudan Relevant Link Exchange 0 07-01-2007 12:38 PM
game power leveling and game gold wwwzhudan Buy / Sell Advertisements Board 0 07-01-2007 12:37 PM


 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91