Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Chess Swift package

### Interactive command line program
```swift
var game = Game()
print(game)

while game.victor == nil {
while !game.isGameOver {
print("\n?", terminator: " ")
guard let line = readLine() else { continue }
do {
Expand All @@ -22,78 +23,77 @@ while game.victor == nil {

#### Output
```
White to move
White to move.

8 r n b q k b n r
7 x x x x x x x x
7 p p p p p p p p
6
5
4
3
2 X X X X X X X X
2 P P P P P P P P
1 R N B Q K B N R
a b c d e f g h

? f3
1. f3

Black to move
Black to move.

8 r n b q k b n r
7 x x x x x x x x
7 p p p p p p p p
6
5
4
3 X
2 X X X X X X X
3 P
2 P P P P P P P
1 R N B Q K B N R
a b c d e f g h

? e6
1. f3 e6

White to move
White to move.

8 r n b q k b n r
7 x x x x x x x
6 x
7 p p p p p p p
6 p
5
4
3 X
2 X X X X X X X
3 P
2 P P P P P P P
1 R N B Q K B N R
a b c d e f g h

? g4
1. f3 e6
2. g4

Black to move
Black to move.

8 r n b q k b n r
7 x x x x x x x
6 x
7 p p p p p p p
6 p
5
4 X
3 X
2 X X X X X X
4 P
3 P
2 P P P P P P
1 R N B Q K B N R
a b c d e f g h

? Qh4
? Qh4#
1. f3 e6
2. g4 Qh4#

Game over
Black wins.
Black wins.

8 r n b k b n r
7 x x x x x x x
6 x
7 p p p p p p p
6 p
5
4 X q
3 X
2 X X X X X X
4 P q
3 P
2 P P P P P P
1 R N B Q K B N R
a b c d e f g h
```
Loading