diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ccfc68..fe6855e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ All notable changes are listed here. Versions follow [Semantic Versioning](https 600–2600, Rodent V 800–3000 (its UCI_Elo). The dialog says that these are the engines' ratings, not a person's Elo. (1.5's slider showed Maia's strength measured on the Lichess blitz scale; a remembered strength keeps its number.) Android too: Maia - 600–2600. + 600–2600. The engine's strength is in its name in the game («Maia 1550»), + with no Elo tag for it. - Offer Maia a draw (desktop and Android): she accepts when she is clearly worse, or when the position is about level (at most +0.2 for her) and has kept its character for her last three moves; after a refusal, again two of her moves later. She judges with diff --git a/apps/desktop/src/game_view.rs b/apps/desktop/src/game_view.rs index 917388c..724c666 100644 --- a/apps/desktop/src/game_view.rs +++ b/apps/desktop/src/game_view.rs @@ -2137,7 +2137,6 @@ impl GameView { &start.user_name, start.user_elo, &start.rival_name(), - start.strength, &start.clock.map_or_else(|| "-".to_owned(), |tc| tc.pgn()), ) { g.set_tag(&name, &value); diff --git a/crates/mobile-api/src/play.rs b/crates/mobile-api/src/play.rs index 07114f1..09fe51b 100644 --- a/crates/mobile-api/src/play.rs +++ b/crates/mobile-api/src/play.rs @@ -82,7 +82,6 @@ pub fn maia_game_tags( &user_name, None, &format!("Maia {strength}"), - strength, "-", ) .into_iter() @@ -229,9 +228,10 @@ impl MaiaPlayer { ) })?; let strength = strength.clamp(PHONE_MIN, PHONE_MAX); - let p = self.maia.predict(&history, strength, opponent.unwrap_or(strength)); - choose(&p, 1.0, random) - .map(|m| m.to_uci(CastlingMode::Standard).to_string()) + let p = self + .maia + .predict(&history, strength, opponent.unwrap_or(strength)); + choose(&p, 1.0, random).map(|m| m.to_uci(CastlingMode::Standard).to_string()) } } diff --git a/crates/play/src/lib.rs b/crates/play/src/lib.rs index c823594..26eb512 100644 --- a/crates/play/src/lib.rs +++ b/crates/play/src/lib.rs @@ -132,16 +132,16 @@ pub fn pause(clock: Option<(Duration, u32)>, ply: usize, only_move: bool) -> Dur // ----- the game's tags ----------------------------------------------------------------- /// The tags of a game against a program (as Lichess writes one): `event` in the app's -/// language, the user's name ("?" unknown) and rating, the program's name («Maia 1500», -/// «Rodent V 2400 (Tal)») and strength, the time control in PGN ("-": none). The rest -/// (date, result) is the game's. +/// language, the user's name ("?" unknown) and rating, the program's name with its +/// strength («Maia 1500», «Rodent V 2400 (Tal)»: the engine's own scale, so no Elo tag +/// for it — the owner's decision), the time control in PGN ("-": none). The rest (date, +/// result) is the game's. pub fn game_tags( event: &str, user: Color, user_name: &str, user_elo: Option, program: &str, - strength: u32, time_control: &str, ) -> Vec<(String, String)> { let maia = program.to_owned(); @@ -151,8 +151,8 @@ pub fn game_tags( user_name.trim().to_owned() }; let (white, black, we, be, wt, bt) = match user { - Color::White => (you, maia, user_elo, Some(strength), "human", "program"), - Color::Black => (maia, you, Some(strength), user_elo, "program", "human"), + Color::White => (you, maia, user_elo, None, "human", "program"), + Color::Black => (maia, you, None, user_elo, "program", "human"), }; let mut tags = vec![ ("Event".to_owned(), event.to_owned()), @@ -380,6 +380,16 @@ impl Judge { mod tests { use super::*; + #[test] + fn the_engine_has_its_strength_in_its_name_and_no_elo() { + let tags = game_tags("Game", Color::Black, "Roman", Some(1500), "Maia 1550", "-"); + let get = |k: &str| tags.iter().find(|(n, _)| n == k).map(|(_, v)| v.as_str()); + assert_eq!(get("White"), Some("Maia 1550")); + assert_eq!(get("WhiteElo"), None); + assert_eq!(get("BlackElo"), Some("1500")); + assert_eq!(get("WhiteType"), Some("program")); + } + #[test] fn maia_resigns_only_when_hopeless() { use uci::Score;