summaryrefslogtreecommitdiff
path: root/features/codebreaker_submits_guess.feature
blob: a36422ffe1785282a88dc3906d5bb4567d40f34a (plain)
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
Feature: code-breaker submits guess

	The code-breaker submits a guess of four colored
	pegs. The mastermind game marks the guess with black
	and white "marker" pegs.

	For each peg in the guess that matches color
	and position of a peg in the secret code, the
	mark includes one black peg. For each additional
	peg in the guess that matches the color but not
	the position of a color in the secret code, a
	white peg is added ot the mark.

	Scenario Outline: submit guess
		Given the secret code is <code>
		When I guess <guess>
		Then the mark should be <mark>

	Scenarios: all colors correct
	| code		| guess		| mark	|
	| r g y c	| r g y c	| bbbb	|
	| r g y c	| r g c y	| bbww	|
	| r g y c	| y r g c	| bwww	|
	| r g y c	| c r g y	| wwww	|

	Scenarios: 3 colors correct
	| code		| guess		| mark	|
	| r g y c	| w g y c	| bbb	|
	| r g y c	| w r y c	| bbw	|
	| r g y c	| w r g c	| bww	|
	| r g y c	| w r g y	| www	|

	Scenarios: 2 colors correct
	| code		| guess		| mark	|
	| r g y c	| w g w c	| bb	|
	| r g y c	| w r w c	| bb	|
	| r g y c	| g w c w	| bw	|
	| r g y c	| w r g y	| ww	|

	Scenarios: 1 color correct
	| code		| guess		| mark	|
	| r g y c	| r w w w	| b		|
	| r g y c	| w w r w	| w		|

	Scenarios: dups in guess match color in code
	| code		| guess		| mark	|
	| r y g c 	| r y g g	| bbb	|
	| r y g c 	| r y c c	| bbb	|
	| r y g c 	| g y r g	| bww	|