Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
fix: fixed bug causing mate scores to compute improperly for Black
Browse files Browse the repository at this point in the history
chore: deprecating this repo
  • Loading branch information
dannyhammer committed Oct 8, 2024
1 parent 24a8d20 commit 3709f47
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# **Deprecation**

This repo was my first foray into chess programming, and it taught me a lot!
I've since split apart the various pieces here into their own repositories.
The primary ones I'd have you visit are [`chessie`](https://github.com/dannyhammer/chessie), my chess move generation library, and [`toad`](https://github.com/dannyhammer/toad), the engine that succeeded `brogle`.

I'm leaving this repository up for now, but may remove it in the future.

# Brogle

Brogle (pronounced 'brog-lee' (like 'broccoli')) is a UCI-compatible chess engine.
Expand Down
2 changes: 1 addition & 1 deletion brogle/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ impl UciEngine for Engine {
// Assistance provided by @Ciekce on Discord
// https://github.com/Ciekce/Stormphrax/blob/main/src/search.cpp#L1163
let score = if data.score.is_mate() {
let dist = Score::MATE - data.score; // distance to mate (in plies)
let dist = Score::MATE - data.score.abs(); // distance to mate (in plies)
let moves_to_mate = if data.score.0 > 0 {
dist.0 + 1
} else {
Expand Down
17 changes: 10 additions & 7 deletions brogle_tools/src/movegen_debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ impl<'a> PerftChecker<'a> {
let results = stdout
.lines()
.filter_map(|line| {
// If there is no space to delimit the move and the node count, then we've reached the end
let mid = line.find(' ')?;

// Split the move and the node count
let (mv, nodes) = line.split_at(mid);
let mv = mv.trim().to_string();
let nodes = nodes.trim().parse().expect("Failed to parse node count");
// Split the move and node count
let mut split = line.split_ascii_whitespace();

// If `next()` fails, we've reached the end of the splitperft results
let mv = split.next()?.trim().to_string();
let nodes = split
.next()?
.trim()
.parse()
.expect("Failed to parse node count");

Some((mv, nodes))
})
Expand Down

0 comments on commit 3709f47

Please sign in to comment.