From 11fd9f55134b81d15bb0d3b8f6e4fcbe606fe8e1 Mon Sep 17 00:00:00 2001 From: davhojt Date: Wed, 1 Jun 2022 10:47:04 +0300 Subject: [PATCH] docs(queens) correct grammar --- subjects/queens/README.md | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/subjects/queens/README.md b/subjects/queens/README.md index 8cee9acf..6cbae6c1 100644 --- a/subjects/queens/README.md +++ b/subjects/queens/README.md @@ -2,21 +2,18 @@ ### Instructions -In a chess game, a queen can attack pieces which are on the same rank, file, or diagonal. +In a chess game, a queen can attack pieces which are on the same rank (row), file (column), or diagonal. -The purpose of this exercise is to find out if two queens can attack each other using the same rules. +The purpose of this exercise is to find out if two queens can attack each other. -The chess board will be represented by the struct `ChessPosition`. You must implement the function `new` -that allows you to verify if the position is valid or not. If the position is valid the function will return that -position, otherwise it will return `None`. +The position of a chess piece on a chessboard will be represented by the struct `ChessPosition`. You must implement the associated function `new` which will return the position if it is valid, otherwise it will return `None`. +> Remember, chessboards have 8 files and 8 ranks (each from 0 to 7). -So, given the position of the two queens on a chess board, you will have to -implement the function `can_attack` in the given struct `Queen` with -the purpose of finding out whether the two queens can attack each other or not. You also need to implement the function `new` -that allows you to create a new `Queen` given a ChessPosition. +You will create the `Queen` struct with the associate function `can_attack`, which will return `true` if the queens can attack each other or not. You also need to implement the function `new` which creates a new `Queen` with a `ChessPosition`. -For example, if the white queen is at (2, 3) and the black queen is at (5, 6), -then the set-up would be like so: +### Example + +If the white queen is at (2, 3) and the black queen is at (5, 6), then the set-up would be like the below. In this case, the two queens can attack each other because both pieces share a diagonal: ``` _ _ _ _ _ _ _ _ @@ -29,8 +26,6 @@ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ``` -In this case, the two queens can attack each other because both pieces share a diagonal. - ### Expected Function and Structures ```rust