Skip to content

Commit

Permalink
Merge pull request #101 from mogproject/develop
Browse files Browse the repository at this point in the history
Update scala.js to version 1.12
  • Loading branch information
mogproject committed Jan 3, 2023
2 parents d9d02c2 + 734f03a commit 928138d
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -27,3 +27,5 @@ project/plugins/project/
# for debug
src/debug/

.sbtopts

7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -4,3 +4,10 @@

# mog-core-scala

**Important**: Create `.sbtopts` in the project directory and specify the path to your Java 1.8 directory.

```
-java-home
~/Library/Java/JavaVirtualMachines/corretto-1.8.0_352/Contents/Home
```

37 changes: 37 additions & 0 deletions jvm/src/test/resources/kif/game/017.kif
@@ -0,0 +1,37 @@
開始日時:2000/12/19 08:03:23
終了日時:2000/12/19 08:06:21
棋戦:R対局 持ち時間15分
手合割:平手
先手:A
後手:B
手数----指手---------消費時間--
1 7六歩(77) ( 0:01/00:00:01)
2 3四歩(33) ( 0:01/00:00:01)
3 2六歩(27) ( 0:02/00:00:03)
4 3五歩(34) ( 0:04/00:00:05)
5 4六歩(47) ( 0:01/00:00:04)
6 3二飛(82) ( 0:02/00:00:07)
7 2二角成(88) ( 0:01/00:00:05)
8 2二銀(31) ( 0:02/00:00:09)
9 6五角打 ( 0:01/00:00:06)
10 3四角打 ( 0:01/00:00:10)
11 4五歩(46) ( 0:03/00:00:09)
12 4五角(34) ( 0:09/00:00:19)
13 7八金(69) ( 0:04/00:00:13)
14 3六歩(35) ( 0:11/00:00:30)
15 3六歩(37) ( 0:03/00:00:16)
16 3六飛(32) ( 0:12/00:00:42)
17 3八飛(28) ( 0:02/00:00:18)
18 3七歩打 ( 0:28/00:01:10)
19 3七飛(38) ( 0:03/00:00:21)
20 3七飛成(36) ( 0:02/00:01:12)
21 3七桂(29) ( 0:01/00:00:22)
22 2七角成(45) ( 0:02/00:01:14)
23 3八銀(39) ( 0:14/00:00:36)
24 2六馬(27) ( 0:15/00:01:29)
25 4三角成(65) ( 0:14/00:00:50)
26 3六歩打 ( 0:09/00:01:38)
27 4五桂(37) ( 0:10/00:01:00)
28 反則勝ち
*王手放置の反則
まで27手で後手の勝ち
Expand Up @@ -170,6 +170,9 @@ class JVMGameSpec extends AnyFlatSpec with Matchers with ScalaCheckDrivenPropert

// Including 全, 圭, and 杏
Game.parseKifString(loadFile("kif/game/016.kif")).trunk.moves.length mustBe 37

// Invalid move on Shogi Club 24
Game.parseKifString(loadFile("kif/game/017.kif")).trunk.moves.length mustBe 26
}

"Game#parseKi2String" must "create games from files" in StateCache.withCache { implicit cache =>
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
@@ -1,6 +1,6 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.7")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")
Expand Down
Expand Up @@ -232,7 +232,7 @@ trait KifBranchReader extends KifGameIO {
case _ => throw new RecordFormatException(n, s"unknown special move: ${x}")
}
special.map(sp => sofar.copy(finalAction = Some(sp))).getOrElse(sofar)
case ((_, Some((_, x)), _) :: Nil, Some((_, mv))) if x.startsWith(IllegalMove.kifKeyword) => // ends with explicit illegal move
case ((_, Some((_, x)), _) :: _, Some((_, mv))) if x.startsWith(IllegalMove.kifKeywordRelaxed) => // ends with explicit illegal move
sofar.copy(finalAction = Some(IllegalMove(mv)))
case ((n, Some((_, x)), _) :: xs, None) =>
val bldr = MoveBuilderKif.parseKifString(NonEmptyLines(n, x))
Expand Down
Expand Up @@ -59,6 +59,7 @@ case class IllegalMove(move: Move) extends SpecialMove {
object IllegalMove {
val csaKeyword = "%ILLEGAL_MOVE"
val kifKeyword = "反則手"
val kifKeywordRelaxed = "反則" // accepts some variants such as "反則勝ち"
val ki2Keyword = "反則"
val usenKeyword = 'i'
}
Expand Down

0 comments on commit 928138d

Please sign in to comment.