From 4eea7f726b5a7e0a55716a5c87e398dfb65fceb7 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 9 Nov 2026 23:00:58 +1300 Subject: refactor: Drop the neural command in favour of play's -S/-T weights files -S and -T already accept a weights file, so the neural subcommand was only a shorthand for one of them. Update the README and CLAUDE.md to show the play form instead. Co-Authored-By: Claude Opus 5.5 --- src/main.rs | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 5237100..9cd8e4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::{path::PathBuf, time::Duration}; -use clap::{Args, Parser, Subcommand, ValueEnum}; +use clap::{Args, Parser, Subcommand}; use crate::{board::Outcome, claude_player::ClaudePlayer, game::GameHandler, local_player::LocalPlayer, network::Network, neural_player::NeuralPlayer, player::Player}; @@ -35,18 +35,6 @@ enum Command { /// Play a game in the terminal (the default) Play(PlayArgs), - /// Play against a trained network - Neural - { - /// Weights file written by `train` - weights: PathBuf, - /// The side you play - #[arg(value_enum, default_value_t = Side::Sheep)] - side: Side, - /// Seconds the network may think per move - #[arg(short, long, default_value_t = 2.0)] - time: f64, - }, /// Time the computer player's search on fixed positions, without the TUI Bench { @@ -93,13 +81,6 @@ fn parse_player(s: &str) -> Result } } -#[derive(Clone, Copy, ValueEnum)] -enum Side -{ - Sheep, - Tiger, -} - #[derive(Args)] struct TrainArgs { @@ -190,17 +171,6 @@ fn main() -> std::io::Result<()> Ok(()) } Some(Command::Train(args)) => train::run(&args.into()), - Some(Command::Neural { weights, side, time }) => - { - let human = PlayerKind::Human; - let computer = PlayerKind::Neural(weights); - let (sheep, tiger) = match side - { - Side::Sheep => (human, computer), - Side::Tiger => (computer, human), - }; - play(PlayArgs { sheep, tiger, time }) - } Some(Command::Play(args)) => play(args), None => play(cli.play), } -- cgit v1.3.1