Find Jobs
Hire Freelancers

MasterMind/CodeBreaker in C++

$30-60 USD

Completed
Posted almost 11 years ago

$30-60 USD

Paid on delivery
Playing Mastermind/Codebreaker Mastermind (or CodeBreaker) is a game played by two players: Maker and Breaker. The Maker secretly chooses a code consisting of 4 pegs, each of which is any of the 6 colors. The Breaker tries to determine the secret code by repeatedly guessing a code of the same format. The Maker provides a response based on how close the guess code is to the secret code. This response is two numbers, called Black and White: Black is how many pegs are correct and in the correct position, and White is how many pegs are correct but in the wrong position. Your goal is to complete two programs: one in which the computer is the Maker and one where the computer is the Breaker. The colors will represent by numbers from 0 - 5. It is assumed that the response given is a nonnegative interger, where tens digit is the Black and the ones digit is the White; so a response of 21 means tat Black was 2 and While was 1, such as when the secret and guess are 1202 and 1052. Task 1: Create a class Code stored in Code.cpp. For this task it needs only to work with the Maker program provided. That is, Code needs -a constructor taking a string -a (static) score function called compare -a (static) function that creates a random code and returns it -a display function that prints out the code The code for Maker should not be changed. Task 2 Create a suitable class CodeList that stores a set/list of Codes. This class will be used by your Breaker program stored in Breaker.cpp. Breaker solves Mastermind by using the "random feasible strategy". That is, each round a guess is chosen at random from the list of all codes that can still be the secret. It is your choice how you store CodeList and what member function you give to CodeList, but please include the following -an array of Codes -an array of booleans signifying whether the corresponding code was still alive -a constructor that creates a list of all possible codes; -a member function that returns a random entry in the (live) list -a filter member function that kills all Codes incompatible with the latest guess and response Task1 Due 5/21/13 Noon Task2 Due 5/24/13 Noon
Project ID: 4536308

About the project

3 proposals
Remote project
Active 11 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Please check private message.
$40 USD in 2 days
4.3 (15 reviews)
4.0
4.0
3 freelancers are bidding on average $50 USD for this job
User Avatar
Hi, I am C++ expert and can surely help you here, Thanks
$60 USD in 2 days
4.8 (108 reviews)
5.9
5.9
User Avatar
Hi, I would like to do this project please, let me know if you are interested so I can start.
$50 USD in 0 day
5.0 (60 reviews)
4.9
4.9

About the client

Flag of UNITED STATES
Clemson, United States
5.0
13
Member since Feb 18, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.