Skip to content

Commit

Permalink
detect tactical motifs in games
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed May 3, 2024
1 parent 11bc7ae commit 8638829
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ lazy val playJson: Project = Project("playJson", file("playJson"))
)
.dependsOn(scalachess)

lazy val motif: Project = Project("motif", file("motif"))
.settings(
commonSettings,
name := "scalachess-motif",
libraryDependencies
)
.dependsOn(scalachess)

lazy val bench = project
.enablePlugins(JmhPlugin)
.settings(commonSettings, scalacOptions -= "-Wunused:all", name := "bench")
Expand Down
2 changes: 2 additions & 0 deletions motif/README.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 14 additions & 0 deletions motif/src/main/scala/Motif.scala
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8638829

Please sign in to comment.