mastermind game1

Upload: meenahil

Post on 03-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Mastermind Game1

    1/9

    Problem Descriptions

    In the game of Mastermind, your

    job as the code-breaker is to

    deduce a hidden configuration of

    4 coloured pegs ("the solution")

    chosen by another person (thecode-maker), by making

    guesses at it. The pegs come in

    six different colours.

    For the purposes of argument,Green=1, Red=2, Black=3,

    Blue=4, Yellow=5, White=6.

    c1-c2-c3-c4

    Hidden fromcode-breaker

  • 7/28/2019 Mastermind Game1

    2/9

    Problem Descriptions

    After each guess is played, the code-

    maker 'marks' the guess, using some

    smaller, slimmer black and white

    pegs, which is called "markers". A

    blackmarker tells you that one of

    your pegs (but you don't know whichone) is the right colour and in the right

    position. A white marker tells you that

    one of your pegs (again you don't

    know which one) is of a colour whichis in the solution, but it's in the wrong

    position.

    The player is given ten guesses to try

    to find the solution.

    c1-c2-c3-c4

    Hidden fromcode-breaker

  • 7/28/2019 Mastermind Game1

    3/9

    Basic Configuration

    Computer

    Code-maker Code-breaker

    During the match, each team will play against another team via

    EMU8086 emulator.

    Each team will take turn to play as code-maker and code-breaker.

    E.g. Game 1: Team 1 code-maker, Team 2 code-breaker

    Game 2: Team 1 code-breaker, Team 2 code-maker

    Change roleTeam 1

    Team 2

  • 7/28/2019 Mastermind Game1

    4/9

  • 7/28/2019 Mastermind Game1

    5/9

    Code-breakerStart

    InitializationSet Line=1Generate the first set of codes

    E.g. 12, 34 for

    Green-Red-Black-Blue

    Wait for

    hints

    No, continue

    (Line++)

    XY=40?

    Received 1byte:

    XY

    X=#black

    Y=#white

    Reply 4-coloured pegs(guess) in 2 bytes format

    E.g. 34, 56 represents

    Black-Blue-Yellow-White

    No

    Line=10 ?

    Yes

    End

    Yes

    The code-breaker shouldbe able to accept the hintsfrom the user, generatesand shows the codes (nextguess) based on the givenhints.

  • 7/28/2019 Mastermind Game1

    6/9

    Assembly Language Programming

    Program flowchart must be included in the report,but not the program listing

    A disk (CD/DVD) with complete source codes

    (*.asm) must be submitted together with the report

    During the development stage, you may useEMU8086 emulator to verify your program

    There should be two separate programs, namely:

    1. Code-maker

    2. Code-breaker

  • 7/28/2019 Mastermind Game1

    7/9

    Mastermind Matches Rules #1 Your opponent will be announced during the match day.

    Each match consists of 2 games. Each team will change

    between the code-maker and code-breaker.

    For e.g., Team 1 code-maker, Team 2 code-

    breaker.i. Team 1 runs the code-maker, Team 2 runs the code-breaker.

    ii. Team 2 enters the codes generated by the code-breaker into Team 1scode-maker.

    iii. Team 1s code-maker generates the hints and Team 2 enters the hints into

    their code-breaker.

    iv. Based on the hints given, Team 2s code-breaker generates the next set of

    codes.v. Steps (ii) to (iv) are repeated until the codes have been broken or 10

    guesses have been attempted

    The code-maker will be awarded 1 point for every

    unsuccessful guess from the code-breaker. e.g., if the

    code-breaker takes 7 steps to get the right answer, then

  • 7/28/2019 Mastermind Game1

    8/9

    MasterMind Matches Rules #2Winner will be determined based on the points accumulated.

    For example, if

    Team 1 vs. Team 2

    P1 as code-maker 6 points (takes 7 steps)

    P2 as code-maker (takes 5 steps) 4 points

    (6-4)

    Team WIN !!!

    Rematch will be conducted in the case of draw

    The winner will enter next round of the tournament

    In case of draw for 3 times even after the rematch isconducted, the

    lecturer will check the programs/algorithm and decide the

    winner.

    The decision is final.

  • 7/28/2019 Mastermind Game1

    9/9

    Matches Marks Matches marks:

    Preliminary (16) +1

    Quarterfinal (8) +1

    Semifinal (4) +1

    Final (2) +1

    1 mark will be given to the team that participates in the matches.

    Each team that successfully proceed to the next round will earn1 extra mark for the matches.

    For example, if you manage to enter semifinal,

    match marks = 1 + 1 + 1 = 3 marks.

    Winner (1) +1