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
92 changes: 92 additions & 0 deletions jvm/src/test/resources/kif/game/015.kif
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#KIF version=2.0 encoding=UTF-8
開始日時:2018/03/07
場所:81Dojo
持ち時間:15分+60秒
手合割:平手
先手:a
後手:b
手数----指手---------消費時間--
1 7六歩(77) (0:5/0:0:5)
2 3四歩(33) (0:6/0:0:6)
3 6六歩(67) (0:5/0:0:10)
4 6四歩(63) (0:24/0:0:30)
5 6八飛(28) (0:7/0:0:17)
6 6二飛(82) (0:2/0:0:32)
7 4八玉(59) (0:9/0:0:26)
8 4二玉(51) (0:4/0:0:36)
9 3八玉(48) (0:2/0:0:28)
10 3二玉(42) (0:5/0:0:41)
11 2八玉(38) (0:1/0:0:29)
12 3三角(22) (0:2/0:0:43)
13 3八銀(39) (0:1/0:0:30)
14 2二玉(32) (0:1/0:0:44)
15 5八金(69) (0:6/0:0:36)
16 3二金(41) (0:6/0:0:50)
17 7七角(88) (0:26/0:1:2)
18 7二金(61) (0:4/0:0:54)
19 7八銀(79) (0:1/0:1:3)
20 7四歩(73) (0:4/0:0:58)
21 6七銀(78) (0:4/0:1:7)
22 7三桂(81) (0:3/0:1:1)
23 8六歩(87) (0:27/0:1:34)
24 8二銀(71) (0:3/0:1:4)
25 4六歩(47) (0:24/0:1:58)
26 6五歩(64) (1:9/0:2:13)
27 同 歩(66) (0:13/0:2:11)
28 同 桂(73) (0:48/0:3:1)
29 3三角成(77) (0:17/0:2:28)
30 同 桂(21) (0:6/0:3:7)
31 5六銀(67) (0:44/0:3:12)
32 5七桂成(65) (1:17/0:4:24)
33 同 金(58) (0:6/0:3:18)
34 6八飛成(62) (0:4/0:4:28)
35 5八金(57) (2:2/0:5:20)
36 6九龍(68) (2:1/0:6:29)
37 1六歩(17) (0:3/0:5:23)
38 8九龍(69) (0:39/0:7:8)
39 1五歩(16) (0:3/0:5:26)
40 6四桂打 (1:9/0:8:17)
41 6五銀(56) (0:19/0:5:45)
42 6一飛打 (1:29/0:9:46)
43 1四桂打 (1:36/0:7:21)
44 同 歩(13) (0:22/0:10:8)
45 同 歩(15) (0:6/0:7:27)
46 2四角打 (1:3/0:11:11)
47 1三角打 (1:34/0:9:1)
48 同 香(11) (0:34/0:11:45)
49 同 歩成(14) (0:2/0:9:3)
50 同 角(24) (0:38/0:12:23)
51 1八香打 (0:10/0:9:13)
52 4六角(13) (2:25/0:14:48)
53 1三歩打 (0:8/0:9:21)
54 2五桂(33) (0:58/0:15:46)
55 4七金(58) (1:36/0:10:57)
56 6八角成(46) (0:37/0:16:23)
57 6四銀(65) (0:6/0:11:3)
58 同 飛(61) (0:36/0:16:59)
59 4五桂打 (0:11/0:11:14)
60 3三金(32) (0:43/0:17:42)
61 同 桂成(45) (0:11/0:11:25)
62 同 玉(22) (0:8/0:17:50)
63 4五歩打 (0:17/0:11:42)
64 9九龍(89) (0:57/0:18:47)
65 3六金(47) (0:9/0:11:51)
66 6九角打 (0:41/0:19:28)
67 4一金打 (1:20/0:13:11)
68 4二銀打 (0:57/0:20:25)
69 1二歩成(13) (0:20/0:13:31)
70 4四歩(43) (0:44/0:21:9)
71 1三香成(18) (0:57/0:14:28)
72 4五歩(44) (0:41/0:21:50)
73 同 金(36) (0:3/0:14:31)
74 4四香打 (0:40/0:22:30)
75 同 金(45) (0:31/0:15:2)
76 同 玉(33) (0:50/0:23:20)
77 4八香打 (0:19/0:15:21)
78 4六歩打 (0:43/0:24:3)
79 4七歩打 (0:38/0:15:59)
80 5五金打 (0:58/0:25:1)
81 2三成香(13) (0:32/0:16:31)
82 9七龍(99) (0:49/0:25:50)
83 1七玉(28) (0:6/0:16:37)
*反則手にて終局
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ class JVMGameSpec extends AnyFlatSpec with Matchers with ScalaCheckDrivenPropert
val s14 = loadFile("kif/game/014.kif")
val g014 = Game.parseKifString(s14)
g014.trunk.moves.length mustBe 156

// Invalid move followed by a comment
val s15 = loadFile("kif/game/015.kif")
val g015 = Game.parseKifString(s15)
g015.trunk.moves.length mustBe 82
}

"Game#parseKi2String" must "create games from files" in StateCache.withCache { implicit cache =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ trait KifBranchReader extends KifGameIO {
}
case None => throw new RecordFormatException(n, s"invalid move: ${x}")
}
case ((_, None, _) :: xs, _) => // ignore comment lines
f(xs, illegal, sofar)
case (_, Some(((x, n), _))) if sofar.status == Playing =>
throw new RecordFormatException(n, s"invalid move expression: ${x}")
case (_ :: xs, _) => // ignore other lines
Expand Down