use pickleball_elo::glicko::{GlickoRating, Glicko2Calculator, calculate_weighted_score};

fn main() {
    println!("Testing Glicko-2 Calculator...\n");
    
    let calc = Glicko2Calculator::new();
    let player = GlickoRating::new_player();
    let opponent = GlickoRating::new_player();
    
    println!("Initial ratings:");
    println!("  Player: {:.1} (RD: {:.1})", player.rating, player.rd);
    println!("  Opponent: {:.1} (RD: {:.1})\n", opponent.rating, opponent.rd);
    
    // Player wins 11-5
    let outcome = calculate_weighted_score(1.0, 11, 5);
    println!("Match: Player wins 11-5");
    println!("Weighted outcome: {:.3}\n", outcome);
    
    let new_rating = calc.update_rating(&player, &[(opponent, outcome)]);
    
    println!("Updated rating:");
    println!("  Player: {:.1} (RD: {:.1}, σ: {:.4})", 
             new_rating.rating, new_rating.rd, new_rating.volatility);
    println!("  Change: {:+.1}", new_rating.rating - player.rating);
    
    println!("\n✅ Test complete!");
}
