<commit_before>var combat = (function() {
    var utils = require('./utilities.js');

    function collectRolls(numRolls) {
        var results = [];

        for (var i=0; i<numRolls; i++) {
            var roll = rollAD6();
            results.push(roll);
        }

        return results.sort().reverse();
    }

    // TODO: currently you have to attack with all your goats; implement squads/military
    function handleRaid(player, target) {
        // Goats fight
        var outcome = resolveCombat(player.goats.length, target.goats.length);
        reportOutcome(outcome, player, target);

        // Outcome decided
        if (outcome.attackerLosses > 0) {
            killGoats(player, outcome.attackerLosses);
            harvestLeather(target, outcome.attackerLosses);
        }

        if (outcome.defenderLosses > 0) {<commit_msg>Attacker only gets leather if some attacking goats survive (to carry it back).<commit_after>var combat = (function() {
    var utils = require('./utilities.js');

    function collectRolls(numRolls) {
        var results = [];

        for (var i=0; i<numRolls; i++) {
            var roll = rollAD6();
            results.push(roll);
        }

        return results.sort().reverse();
    }

    // TODO: currently you have to attack with all your goats; implement squads/military
    function handleRaid(player, target) {
        // Goats fight
        var outcome = resolveCombat(player.goats.length, target.goats.length);
        reportOutcome(outcome, player, target);

        // Outcome decided
        if (outcome.attackerLosses > 0) {
            killGoats(player, outcome.attackerLosses);
            if (player.goats.length > 0) {
                // Attacker only gets leather if he has goats to carry it back!
                harvestLeather(target, outcome.attackerLosses);
            }
        }

        if (outcome.defenderLosses > 0) {
{'fraction_non_alphanumeric': 0.11, 'fraction_numerical': 0.004736842105263158, 'mean_word_length': 2.1736227045075127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7272885', 'n_tokens_mistral': 559, 'n_tokens_neox': 529, 'n_words': 141}