diff --git a/build.sbt b/build.sbt index 999f52d69..17f717df6 100644 --- a/build.sbt +++ b/build.sbt @@ -54,6 +54,13 @@ lazy val playJson: Project = Project("playJson", file("playJson")) ) .dependsOn(scalachess) +lazy val motif: Project = Project("motif", file("motif")) + .settings( + commonSettings, + name := "scalachess-motif" + ) + .dependsOn(scalachess) + lazy val bench = project .enablePlugins(JmhPlugin) .settings(commonSettings, scalacOptions -= "-Wunused:all", name := "bench") diff --git a/motif/README.md b/motif/README.md new file mode 100644 index 000000000..3001b1272 --- /dev/null +++ b/motif/README.md @@ -0,0 +1,2 @@ +Detect tactical motifs in games. +Similar to what [the puzzle tagger](https://github.com/ornicar/lichess-puzzler/blob/master/tagger/cook.py) does. diff --git a/motif/src/main/scala/Motif.scala b/motif/src/main/scala/Motif.scala new file mode 100644 index 000000000..363dfa25d --- /dev/null +++ b/motif/src/main/scala/Motif.scala @@ -0,0 +1,14 @@ +package chess +package motif + +enum Motif: + case fork + case doubleCheck + case xRay + +case class MotifAt(motif: Motif, at: Ply) + +object MotifAt: + + def findAll(replay: Replay): List[MotifAt] = + Nil