bioshogi 0.0.4 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.org +1 -1
- data/bin/bioshogi +1 -1
- data/lib/bioshogi/cli.rb +2 -5
- data/lib/bioshogi/explain/distribution_ratio.rb +1239 -1193
- data/lib/bioshogi/explain/shape_info.rb +3 -3
- data/lib/bioshogi/input_parser.rb +9 -0
- data/lib/bioshogi/piece.rb +9 -1
- data/lib/bioshogi/version.rb +1 -1
- data/lib/bioshogi.rb +1 -2
- metadata +2 -5
- data/lib/bioshogi/cli/.gitignore +0 -1
- data/lib/bioshogi/cli/input_checker.rb +0 -21
- data/lib/bioshogi/cli/piece.rb +0 -26
@@ -3280,10 +3280,10 @@ EOT
|
|
3280
3280
|
| ・ ・ ・ ・ ・ ・ ・ ・ ・|
|
3281
3281
|
| ・ ・ ・ ・ ・ ・ ・ ・ ・|
|
3282
3282
|
| ・ ・ ・ ・ ・ ・ ・ ・ ・|
|
3283
|
-
|
|
3283
|
+
| ・ ・ 歩 ● 歩 ・ ・ ・ ・|
|
3284
3284
|
| ・ ・ 桂 銀 銀 歩 歩 歩 歩|
|
3285
|
-
| ・ ・
|
3286
|
-
| ・ 飛
|
3285
|
+
| ・ ・ ・!金 ・!金!金 ・ ・|
|
3286
|
+
| ・ 飛 ○ ○ ○ ○ ○ ・ ・|
|
3287
3287
|
+---------------------------+
|
3288
3288
|
EOT
|
3289
3289
|
},
|
@@ -4,6 +4,15 @@ module Bioshogi
|
|
4
4
|
module InputParser
|
5
5
|
extend self
|
6
6
|
|
7
|
+
concern :CLI do
|
8
|
+
included do
|
9
|
+
desc "input_match", "指し手の一つ分の入力の読み取り"
|
10
|
+
def input_match(*argv)
|
11
|
+
InputParser.check(argv.join(" "))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
7
16
|
def check(text)
|
8
17
|
rows = InputParser.scan(text).collect do |str|
|
9
18
|
{"入力" => str}.merge(match!(str).named_captures)
|
data/lib/bioshogi/piece.rb
CHANGED
@@ -11,6 +11,15 @@
|
|
11
11
|
|
12
12
|
module Bioshogi
|
13
13
|
class Piece
|
14
|
+
concern :CLI do
|
15
|
+
included do
|
16
|
+
desc "piece", "駒一覧"
|
17
|
+
def piece
|
18
|
+
tp Piece.collect(&:to_h)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
14
23
|
class << self
|
15
24
|
# 持駒文字列から駒配列に変換
|
16
25
|
# Piece.s_to_a("飛0 角 竜1 馬2 龍2 飛").collect(&:name) # => ["飛", "飛", "飛", "飛", "角", "角", "角"]
|
@@ -273,4 +282,3 @@ module Bioshogi
|
|
273
282
|
end
|
274
283
|
end
|
275
284
|
end
|
276
|
-
|
data/lib/bioshogi/version.rb
CHANGED
data/lib/bioshogi.rb
CHANGED
@@ -43,8 +43,6 @@ if true
|
|
43
43
|
loader.ignore("#{__dir__}/bioshogi/errors.rb")
|
44
44
|
loader.ignore("#{__dir__}/bioshogi/contrib/**/*.rb")
|
45
45
|
loader.ignore("#{__dir__}/bioshogi/assets")
|
46
|
-
loader.ignore("#{__dir__}/bioshogi/cli.rb")
|
47
|
-
loader.ignore("#{__dir__}/bioshogi/cli")
|
48
46
|
loader.ignore("#{__dir__}/bioshogi/explain/{備考,囲い,戦型,手筋}")
|
49
47
|
|
50
48
|
# 変換ルール調整
|
@@ -57,6 +55,7 @@ if true
|
|
57
55
|
loader.do_not_eager_load("#{__dir__}/bioshogi/explain/file_normalizer.rb")
|
58
56
|
loader.do_not_eager_load("#{__dir__}/bioshogi/extreme_validator.rb")
|
59
57
|
loader.do_not_eager_load("#{__dir__}/bioshogi/formatter/animation/demo_builder.rb")
|
58
|
+
loader.do_not_eager_load("#{__dir__}/bioshogi/cli.rb")
|
60
59
|
|
61
60
|
# CLI用
|
62
61
|
# loader.do_not_eager_load("#{__dir__}/bioshogi/commands/*.rb")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bioshogi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Ikeda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -625,9 +625,6 @@ files:
|
|
625
625
|
- lib/bioshogi/board_parser/sfen_board_parser.rb
|
626
626
|
- lib/bioshogi/builder.rb
|
627
627
|
- lib/bioshogi/cli.rb
|
628
|
-
- lib/bioshogi/cli/.gitignore
|
629
|
-
- lib/bioshogi/cli/input_checker.rb
|
630
|
-
- lib/bioshogi/cli/piece.rb
|
631
628
|
- lib/bioshogi/container.rb
|
632
629
|
- lib/bioshogi/container/basic.rb
|
633
630
|
- lib/bioshogi/container/checkmate_yomiage.rb
|
data/lib/bioshogi/cli/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
output
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require "../cli" if $0 == __FILE__
|
2
|
-
|
3
|
-
module Bioshogi
|
4
|
-
class CLI
|
5
|
-
desc "input_checker", "入力"
|
6
|
-
def input_checker(*argv)
|
7
|
-
InputParser.check(argv.join(" "))
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
if $0 == __FILE__
|
13
|
-
Bioshogi::CLI.start(["input_checker", "68S", "△76歩 34歩"])
|
14
|
-
end
|
15
|
-
# >> |--------+--------------+-----------+----------+-----------+------------+----------------+-------------+--------------+---------------------+------------------+----------------+----------+----------+--------+-----------+-----------------+-------------------+---------+-----------+----------------------|
|
16
|
-
# >> | 入力 | ki2_location | kif_place | ki2_same | kif_piece | ki2_one_up | ki2_left_right | ki2_up_down | ki2_as_it_is | ki2_promote_trigger | kif_drop_trigger | kif_place_from | csa_sign | csa_from | csa_to | csa_piece | sfen_drop_piece | sfen_drop_trigger | sfen_to | sfen_from | sfen_promote_trigger |
|
17
|
-
# >> |--------+--------------+-----------+----------+-----------+------------+----------------+-------------+--------------+---------------------+------------------+----------------+----------+----------+--------+-----------+-----------------+-------------------+---------+-----------+----------------------|
|
18
|
-
# >> | 68S | | 68 | | S | | | | | | | | | | | | | | | | |
|
19
|
-
# >> | △76歩 | △ | 76 | | 歩 | | | | | | | | | | | | | | | | |
|
20
|
-
# >> | 34歩 | | 34 | | 歩 | | | | | | | | | | | | | | | | |
|
21
|
-
# >> |--------+--------------+-----------+----------+-----------+------------+----------------+-------------+--------------+---------------------+------------------+----------------+----------+----------+--------+-----------+-----------------+-------------------+---------+-----------+----------------------|
|
data/lib/bioshogi/cli/piece.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require "../cli" if $0 == __FILE__
|
2
|
-
|
3
|
-
module Bioshogi
|
4
|
-
class CLI
|
5
|
-
desc "piece", "駒一覧"
|
6
|
-
def piece
|
7
|
-
tp Piece.collect(&:to_h)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
if $0 == __FILE__
|
13
|
-
Bioshogi::CLI.start(["piece"])
|
14
|
-
end
|
15
|
-
# >> |--------+------+-------------+---------------+----------------------------+------------------------------+-----------+------------+--------------+----------+------|
|
16
|
-
# >> | key | name | basic_alias | promoted_name | promoted_formal_sheet_name | other_matched_promoted_names | sfen_char | promotable | always_alive | stronger | code |
|
17
|
-
# >> |--------+------+-------------+---------------+----------------------------+------------------------------+-----------+------------+--------------+----------+------|
|
18
|
-
# >> | king | 玉 | 王 | | | | K | false | true | false | 0 |
|
19
|
-
# >> | rook | 飛 | | 龍 | | 竜 | R | true | true | true | 1 |
|
20
|
-
# >> | bishop | 角 | | 馬 | | | B | true | true | true | 2 |
|
21
|
-
# >> | gold | 金 | | | | | G | false | true | false | 3 |
|
22
|
-
# >> | silver | 銀 | | 全 | 成銀 | | S | true | true | false | 4 |
|
23
|
-
# >> | knight | 桂 | | 圭 | 成桂 | 今 | N | true | false | false | 5 |
|
24
|
-
# >> | lance | 香 | | 杏 | 成香 | 仝 | L | true | false | false | 6 |
|
25
|
-
# >> | pawn | 歩 | | と | | | P | true | false | false | 7 |
|
26
|
-
# >> |--------+------+-------------+---------------+----------------------------+------------------------------+-----------+------------+--------------+----------+------|
|