chess 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chess.gemspec +2 -1
- data/doc/Chess/Board.html +7 -5
- data/doc/created.rid +15 -15
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/ext/bitboard.c +1 -1
- data/ext/bitboard.h +1 -1
- data/ext/board.c +1 -1
- data/ext/board.h +1 -1
- data/ext/chess.c +3 -3
- data/ext/chess.h +1 -1
- data/ext/common.c +1 -1
- data/ext/common.h +1 -1
- data/ext/game.c +1 -1
- data/ext/game.h +1 -1
- data/ext/special.c +1 -1
- data/ext/special.h +1 -1
- data/lib/chess/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1b122a9e2e4ddaf1384bb4436f27d657c0691fd
|
4
|
+
data.tar.gz: 806cded3d3289d7766774e898315634698bd94e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8613eb5ba2e25085ac2988f8184e4ad2b961e26846c1bc62aade2a7d1bc28162a904c921ce3b6d46f52a03a4b9fc5cc12cc7d01edc0fb75ab11eb68c7ef9aa48
|
7
|
+
data.tar.gz: 0e57bca085a33d11f4ebc0690cfa04da76472cb432b2b96a35d01c27c65e035794f154c8c317a3632e239c0622827a52410f938f036def5ff6a0096adaf792b7
|
data/chess.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'chess'
|
7
7
|
s.version = Chess::VERSION
|
8
8
|
s.authors = ['Enrico Pilotto']
|
9
|
-
s.email = ['
|
9
|
+
s.email = ['epilotto@gmx.com']
|
10
10
|
s.homepage = 'https://github.com/pioz/chess'
|
11
11
|
s.summary = %q{A fast chess library to play chess with Ruby.}
|
12
12
|
s.description = %q{A fast chess library that use bitboards to play chess with Ruby.}
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.extensions = ['ext/extconf.rb']
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
23
|
+
s.required_ruby_version = '>= 1.9'
|
23
24
|
s.add_development_dependency 'bundler', '~> 1.14'
|
24
25
|
s.add_development_dependency 'rake', '~> 12.0'
|
25
26
|
s.add_development_dependency 'minitest', '~> 5.10'
|
data/doc/Chess/Board.html
CHANGED
@@ -151,7 +151,7 @@ calculations. This ensures a fast library.</p>
|
|
151
151
|
<div class="method-description">
|
152
152
|
|
153
153
|
<p>Returns the piece on the <code>square</code> of the chessboard. If there is
|
154
|
-
no piece or the square is not valid return
|
154
|
+
no piece or the square is not valid return <code>nil</code>.</p>
|
155
155
|
|
156
156
|
<p>Each square on the chessboard is represented by an integer according to the
|
157
157
|
following scheme:</p>
|
@@ -170,10 +170,9 @@ following scheme:</p>
|
|
170
170
|
<p>Parameters are:</p>
|
171
171
|
<dl class="rdoc-list note-list"><dt><code>square</code>
|
172
172
|
<dd>
|
173
|
-
<p>the square of the board. Can be
|
173
|
+
<p>the square of the board. Can be an integer between 0 and 63 or a string
|
174
|
+
like 'a2', 'c5'…</p>
|
174
175
|
</dd></dl>
|
175
|
-
|
176
|
-
<p>string like 'a2', 'c5'… The string must be downcase.</p>
|
177
176
|
|
178
177
|
|
179
178
|
|
@@ -190,7 +189,10 @@ board_get_piece (VALUE self, VALUE square)
|
|
190
189
|
else
|
191
190
|
i = FIX2INT (square);
|
192
191
|
char piece = board->placement[i];
|
193
|
-
|
192
|
+
if (i < 0 || i > 63 || !piece)
|
193
|
+
return Qnil;
|
194
|
+
else
|
195
|
+
return rb_str_new (&piece, 1);
|
194
196
|
}</pre>
|
195
197
|
</div>
|
196
198
|
|
data/doc/created.rid
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
|
2
|
-
README.rdoc
|
3
|
-
lib/chess.rb
|
4
|
-
lib/chess/exceptions.rb
|
5
|
-
lib/chess/game.rb
|
6
|
-
lib/chess/gnuchess.rb
|
7
|
-
lib/chess/pgn.rb
|
8
|
-
lib/chess/utf8_notation.rb
|
9
|
-
lib/chess/version.rb
|
10
|
-
ext/bitboard.c
|
11
|
-
ext/board.c
|
12
|
-
ext/chess.c
|
13
|
-
ext/common.c
|
14
|
-
ext/game.c
|
15
|
-
ext/special.c
|
1
|
+
Tue, 01 Aug 2017 23:53:08 +0200
|
2
|
+
README.rdoc Tue, 01 Aug 2017 23:51:18 +0200
|
3
|
+
lib/chess.rb Tue, 01 Aug 2017 23:51:18 +0200
|
4
|
+
lib/chess/exceptions.rb Tue, 01 Aug 2017 23:51:18 +0200
|
5
|
+
lib/chess/game.rb Tue, 01 Aug 2017 23:51:18 +0200
|
6
|
+
lib/chess/gnuchess.rb Tue, 01 Aug 2017 23:51:18 +0200
|
7
|
+
lib/chess/pgn.rb Tue, 01 Aug 2017 23:51:18 +0200
|
8
|
+
lib/chess/utf8_notation.rb Tue, 01 Aug 2017 23:51:18 +0200
|
9
|
+
lib/chess/version.rb Tue, 01 Aug 2017 23:51:18 +0200
|
10
|
+
ext/bitboard.c Tue, 01 Aug 2017 23:51:18 +0200
|
11
|
+
ext/board.c Tue, 01 Aug 2017 23:51:18 +0200
|
12
|
+
ext/chess.c Tue, 01 Aug 2017 23:52:43 +0200
|
13
|
+
ext/common.c Tue, 01 Aug 2017 23:51:18 +0200
|
14
|
+
ext/game.c Tue, 01 Aug 2017 23:51:18 +0200
|
15
|
+
ext/special.c Tue, 01 Aug 2017 23:51:18 +0200
|
data/doc/js/navigation.js.gz
CHANGED
Binary file
|
data/doc/js/search_index.js.gz
CHANGED
Binary file
|
data/doc/js/searcher.js.gz
CHANGED
Binary file
|
data/ext/bitboard.c
CHANGED
data/ext/bitboard.h
CHANGED
data/ext/board.c
CHANGED
data/ext/board.h
CHANGED
data/ext/chess.c
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* chess - a fast library to play chess in Ruby
|
3
3
|
*
|
4
|
-
* Copyright (c) 2011-
|
4
|
+
* Copyright (c) 2011-2017, Enrico Pilotto <epilotto@gmx.com>
|
5
5
|
* This code is under LICENSE LGPLv3
|
6
6
|
*/
|
7
7
|
|
@@ -439,8 +439,8 @@ board_placement (VALUE self)
|
|
439
439
|
* a b c d e f g h
|
440
440
|
*
|
441
441
|
* Parameters are:
|
442
|
-
* +square+:: the square of the board. Can be
|
443
|
-
*
|
442
|
+
* +square+:: the square of the board. Can be an integer between 0 and 63 or a
|
443
|
+
* string like 'a2', 'c5'...
|
444
444
|
*/
|
445
445
|
VALUE
|
446
446
|
board_get_piece (VALUE self, VALUE square)
|
data/ext/chess.h
CHANGED
data/ext/common.c
CHANGED
data/ext/common.h
CHANGED
data/ext/game.c
CHANGED
data/ext/game.h
CHANGED
data/ext/special.c
CHANGED
data/ext/special.h
CHANGED
data/lib/chess/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Enrico Pilotto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
version: '5.1'
|
69
69
|
description: A fast chess library that use bitboards to play chess with Ruby.
|
70
70
|
email:
|
71
|
-
-
|
71
|
+
- epilotto@gmx.com
|
72
72
|
executables: []
|
73
73
|
extensions:
|
74
74
|
- ext/extconf.rb
|
@@ -1377,7 +1377,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1377
1377
|
requirements:
|
1378
1378
|
- - ">="
|
1379
1379
|
- !ruby/object:Gem::Version
|
1380
|
-
version: '
|
1380
|
+
version: '1.9'
|
1381
1381
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1382
1382
|
requirements:
|
1383
1383
|
- - ">="
|