main
1Feature: code-breaker submits guess
2
3 The code-breaker submits a guess of four colored
4 pegs. The mastermind game marks the guess with black
5 and white "marker" pegs.
6
7 For each peg in the guess that matches color
8 and position of a peg in the secret code, the
9 mark includes one black peg. For each additional
10 peg in the guess that matches the color but not
11 the position of a color in the secret code, a
12 white peg is added ot the mark.
13
14 Scenario Outline: submit guess
15 Given the secret code is <code>
16 When I guess <guess>
17 Then the mark should be <mark>
18
19 Scenarios: all colors correct
20 | code | guess | mark |
21 | r g y c | r g y c | bbbb |
22 | r g y c | r g c y | bbww |
23 | r g y c | y r g c | bwww |
24 | r g y c | c r g y | wwww |
25
26 Scenarios: 3 colors correct
27 | code | guess | mark |
28 | r g y c | w g y c | bbb |
29 | r g y c | w r y c | bbw |
30 | r g y c | w r g c | bww |
31 | r g y c | w r g y | www |
32
33 Scenarios: 2 colors correct
34 | code | guess | mark |
35 | r g y c | w g w c | bb |
36 | r g y c | w r w c | bb |
37 | r g y c | g w c w | bw |
38 | r g y c | w r g y | ww |
39
40 Scenarios: 1 color correct
41 | code | guess | mark |
42 | r g y c | r w w w | b |
43 | r g y c | w w r w | w |
44
45 Scenarios: dups in guess match color in code
46 | code | guess | mark |
47 | r y g c | r y g g | bbb |
48 | r y g c | r y c c | bbb |
49 | r y g c | g y r g | bww |
50
51