Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Rook #6

Closed
ecattez opened this issue Jan 16, 2020 · 0 comments
Closed

Feature: Rook #6

ecattez opened this issue Jan 16, 2020 · 0 comments
Labels

Comments

@ecattez
Copy link
Owner

ecattez commented Jan 16, 2020

Feature: Rook

Scenario: A rook can move horizontally and vertically while it is not obstructed

GIVEN a <color> rook in <from>
AND the squares between <from> and <to> are vacant
WHEN the rook is moved <times> <direction>
THEN the rook is in <to>

Example:
        | color | from | times | direction | to |
        | WHITE | A1 | 4 | FORWARD | A5 |
        | WHITE | A5 | 2 | SHIFT_RIGHT | C5 |
        | WHITE | C5 | 2 | SHIFT_LEFT | A5 |
        | WHITE | A5 | 4 | BACKWARD | A1 |
        | BLACK | A8 | 4 | FORWARD | A4 |
        | BLACK | A4 | 2 | SHIFT_LEFT | C4 |
        | BLACK | C4 | 2 | SHIFT_RIGHT | A4 |
        | BLACK | A4 | 4 | BACKWARD | A8 |

Scenario: Rook can not move beyond an obstructed path

GIVEN a <color> rook in <from>
AND the square <obstructed> is not vacant
WHEN the rook is moved <time> <direction>
THEN the move is refused

Example:
        | color | from | obstructed | times | direction |
        | WHITE | A1 | A3 | 4 | FORWARD |
        | WHITE | A5 | C5 | 2 | SHIFT_RIGHT |
        | WHITE | E5 | C5 | 2 | SHIFT_LEFT |
        | WHITE | A5 | A3 | 4 | BACKWARD |
        | BLACK | A8 | A6 | 4 | FORWARD |
        | BLACK | A4 | C4 | 2 | SHIFT_LEFT |
        | BLACK | E4 | C4 | 2 | SHIFT_RIGHT |
        | BLACK | A4 | A6 | 2 | BACKWARD |

Scenario: Rook can capture an opposing piece that obstruct its way

GIVEN a <color> rook in <from>
AND an opposing piece in <to>
WHEN the rook is moved to <to>
THEN the rook captures the opposing piece

Example:
        | color | from | to |
        | WHITE | A1 | A3 |
        | WHITE | A5 | C5 |
        | WHITE | E5 | C5 |
        | WHITE | A5 | A3 |
        | BLACK | A8 | A6 |
        | BLACK | A4 | C4 |
        | BLACK | E4 | C4 |
        | BLACK | A4 | A6 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant