File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 6
6
// Copyright © 2017 Tigerpixel Ltd. All rights reserved.
7
7
//
8
8
9
- import Foundation
10
9
import ParserCombinator
11
10
12
11
/// The positions on the board conform to an interger number.
@@ -17,7 +16,7 @@ typealias BoardPosition = Int
17
16
*/
18
17
public struct DraughtsPieceMove {
19
18
20
- /// The starting position of the piece which should be moved.
19
+ /// The location of the piece which should be moved.
21
20
let origin : BoardPosition
22
21
/// The resting position of the piece after the move is made.
23
22
let destination : BoardPosition
@@ -41,7 +40,7 @@ extension DraughtsPieceMove {
41
40
- parameter to: The location at which the piece resides after the move.
42
41
*/
43
42
init ( origin: BoardPosition , isCapture: Bool , destination: BoardPosition ) {
44
-
43
+
45
44
self . origin = origin
46
45
self . destination = destination
47
46
self . isCapture = isCapture
@@ -52,8 +51,8 @@ extension DraughtsPieceMove {
52
51
/**
53
52
A description of the movement of pieces by both players.
54
53
55
- Black is optional as it may not have moved in this round.
56
54
A move in technical draughts terms refers to a round of moves by both players.
55
+ Black is optional as it may not have moved in this round.
57
56
*/
58
57
public struct DraughtsMove {
59
58
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ import ParserCombinator
10
10
import Currier
11
11
12
12
/**
13
- Creates a parser to parse a description a draughts game in portable game notation to DraughtsMove objects.
13
+ Creates a parser to parse a description of a draughts game in portable game notation to DraughtsMove objects.
14
14
*/
15
15
struct DraughtsNotationParser {
16
16
17
17
/**
18
- Create a parser which performs the parseing of portable game notation for draughts.
18
+ Create a parser which performs the parsing of portable game notation for draughts.
19
19
20
20
Once created the parser can be called multiple times for multiple input game strings.
21
21
@@ -49,7 +49,7 @@ struct DraughtsNotationParser {
49
49
50
50
- parameter turn: A parser for a single turn performed by one player.
51
51
52
- - returns: A parser for a draughts move object describing both playes turn for a move.
52
+ - returns: A parser for a draughts move object describing both player's turns for a move.
53
53
*/
54
54
private static func twoPlayerTurn( _ turn: Parser < DraughtsPieceMove > ) -> Parser < DraughtsMove > {
55
55
Original file line number Diff line number Diff line change @@ -277,8 +277,8 @@ class DraughtsMoveTests: XCTestCase {
277
277
switch DraughtsMove . parse ( fromPortableGameNotation: missingRoundNumber) {
278
278
case . success( let moves, let tail) :
279
279
280
- // NOTE: This situation succeeds because there are valid results at the start of the input sting.
281
- // This may be deemed as unexpected and it may be better to find a way to make this fail.
280
+ // NOTE: This succeeds because there are valid results at the start of the input sting.
281
+ // It may be deemed as unexpected and it may be better to find a way to make this fail.
282
282
283
283
XCTAssertEqual ( 1 , moves. count)
284
284
XCTAssertEqual ( " 14x23 27x18 " , String ( tail) )
You can’t perform that action at this time.
0 commit comments