Skip to content

Commit

Permalink
refactor book building tool into separate crate
Browse files Browse the repository at this point in the history
  • Loading branch information
MinusKelvin committed Oct 12, 2020
1 parent 0334997 commit f4e7cc6
Show file tree
Hide file tree
Showing 19 changed files with 16 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ playout*
Cargo.lock
options.yaml
replay.dat
/opening-book/book
*.ccbook
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ members = [
"opening-book",
"c-api",
"compare",
"optimizer"
"optimizer",
"opening-book/book-builder"
]
9 changes: 0 additions & 9 deletions opening-book/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ libtetris = { path = "../libtetris" }
enumset = { version = "0.4.0", features = ["serde"] }
serde = "1.0"
bincode = "1.3.1"

fumen = { version = "0.1.1", optional = true }
permutator = { version = "0.4.0", optional = true }
flate2 = "1.0.18"

[features]
bin = ["fumen", "permutator", "builder"]
builder = []
default = ["bin"]

[[bin]]
name = "main"
required-features = ["bin"]
14 changes: 14 additions & 0 deletions opening-book/book-builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "book-builder"
version = "0.1.0"
authors = ["MinusKelvin <mark.carlson@minuskelvin.net>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
opening-book = { path = "..", features = ["builder"] }
libtetris = { path = "../../libtetris" }
fumen = "0.1.1"
permutator = "0.4.0"
enumset = "0.4.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions opening-book/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ impl BookBuilder {
moves
});
}
dbg!(book.len());
Book(book)
}

Expand All @@ -234,7 +233,6 @@ impl BookBuilder {
}
sequences.sort_by_key(|&(s, _)| s);
sequences.dedup_by_key(|&mut (_, m)| m);
dbg!(sequences.len());
sequences
}
}
Expand Down

0 comments on commit f4e7cc6

Please sign in to comment.