Sie sind auf Seite 1von 9

Problem Descriptions

Hidden from code-breaker

c1-c2-c3-c4 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 (the code-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.

Problem Descriptions
Hidden from code-breaker

c1-c2-c3-c4

After each guess is played, the codemaker 'marks' the guess, using some smaller, slimmer black and white pegs, which is called "markers". A black marker tells you that one of your pegs (but you don't know which one) 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 which is in the solution, but it's in the wrong position. The player is given ten guesses to try to find the solution.

Basic Configuration
Computer

Code-maker Team 1
Change role

Code-breaker

Team 2

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

Code-maker
Start
E.g. 12, 44 represents Green-Red-Blue-Blue

Generate codes in 2 bytes format Set Line = 1

Select 4-coloured pegs (should be as random as possible)

The secret codes should be shown to ensure that correct hints are given The code-maker should also include an interface to allow the user to enter the codes and show each line of codes (colors) attempted by the user as well as the hints given. The interface can be either text-based or graphic-based.

Wait for codes

Received 2 bytes: PQ=c1-c2 RS=c3-c4 PQ, RS Reply Hints XY


X=#black Y=#white

Yes

End

Game over

Line=10 or XY=40?

No, continue (Line++)

Code-breaker
Start
Set Line=1 Generate the first set of codes E.g. 12, 34 for Green-Red-Black-Blue

Initialization
X=#black Y=#white Yes

Received 1byte: XY Wait for XY=40? hints


No

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


E.g. 34, 56 represents Black-Blue-Yellow-White Yes

Line=10 ?

No, continue (Line++)


The code-breaker should be able to accept the hints from the user, generates and shows the codes (next guess) based on the given hints.

End

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 use EMU8086 emulator to verify your program There should be two separate programs, namely: 1. Code-maker 2. Code-breaker

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 codebreaker.
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 1s code-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

MasterMind Matches Rules #2


Winner 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 is conducted, the lecturer will check the programs/algorithm and decide the winner. The decision is final.

Matches Marks
Matches marks:
Winner (1) +1 Final (2) +1

Semifinal (4) +1
Quarterfinal (8) +1 Preliminary (16) +1

1 mark will be given to the team that participates in the matches. Each team that successfully proceed to the next round will earn 1 extra mark for the matches. For example, if you manage to enter semifinal, match marks = 1 + 1 + 1 = 3 marks.

Das könnte Ihnen auch gefallen