<commit_before>var World = require('../world');
var Config = require('../../shared/config.js');
var Util = require('../test_util.js');

exports.testAttackTorpedo01 = function(test) {

    var map = [
        "+-----------------------------------------------+",
        "|   | 0  1  2  3  4  5  6  7  8  9  10 11 12 13 |",
        "|---+-------------------------------------------|",
        "|0  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|1  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|2  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|3  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|4  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|5  | .  .  .  .  .  .  .  .  .  .  2p .  .  .  |",
        "|6  | .  .  .  .  .  .  .  1v 1t .  .  2p .  .  |",
        "|7  | .  .  .  .  .  .  .  .  .  .  2p .  .  .  |",
        "|8  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|9  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|10 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|11 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|12 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|13 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "+-----------------------------------------------+"
    ];

    var world = new World();

    Util.setupWorld(test, world, map, world.players[0].id, Config.ATTACK_PHASE);
    Util.testWhereCanAttack(test, world, [7, 6], [], [[7, 5], [7, 7], [6, 6], [8, 6]]);
    Util.testWhereCanAttack(test, world, [8, 6], [[10, 5], [10, 7], [11, 6]], []);

    test.done();
};

exports.testAttackTorpedo02 = function(test) {

    var map = [
        "+-----------------------------------------------+",
        "|   | 0  1  2  3  4  5  6  7  8  9  10 11 12 13 |",
        "|---+-------------------------------------------|",
        "|0  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|1  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|2  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|3  | .  .  .  .  .  .  .  2s .  .  .  .  .  .  |",
        "|4  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|5  | .  .  .  .  .  .  .  1t .  .  .  .  .  .  |",
        "|6  | .  .  .  2fM.  .  1t 1v 1t .  .  2p .  .  |",
        "|7  | .  .  .  .  .  .  .  1t .  .  2p .  .  .  |",
        "|8  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|9  | .  .  .  .  .  .  2B .  .  .  .  .  .  .  |",
        "|10 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|11 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|12 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|13 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "+-----------------------------------------------+"
    ];

    var world = new World();

    Util.setupWorld(test, world, map, world.players[0].id, Config.ATTACK_PHASE);
    Util.testWhereCanAttack(test, world, [7, 6], [], [[7, 5], [7, 7], [6, 6], [8, 6]]);
    Util.testWhereCanAttack(test, world, [8, 6], [[10, 7], [11, 6]], [[10, 5]]);
    Util.testWhereCanAttack(test, world, [6, 6], [[3, 6]], [[4, 5], [4, 7]]);
    Util.testWhereCanAttack(test, world, [7, 5], [], [[7, 2], [6, 3], [8, 3]]);
    Util.testWhereCanAttack(test, world, [7, 7], [[6, 9]], [[7, 10], [8, 9]]);

    test.done();
};

exports.testAttackAirplain01 = function(test) {

    var map = [
        "+-----------------------------------------------+",
        "|   | 0  1  2  3  4  5  6  7  8  9  10 11 12 13 |",
        "|---+-------------------------------------------|",
        "|0  | .  .  .  .  .  .  2B .  .  .  .  .  .  .  |",
        "|1  | .  .  .  .  .  .  1p .  .  .  .  .  .  .  |",
        "|2  | .  .  .  .  .  .  2p .  .  .  .  .  .  .  |",
        "|3  | .  .  .  .  .  1s .  .  .  .  .  .  .  .  |",
        "|4  | .  .  .  .  .  2s .  .  .  .  .  .  .  .  |",
        "|5  | .  .  .  .  .  .  2b .  .  .  .  .  .  .  |",
        "|6  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|7  | .  .  .  .  .  .  2fS.  .  .  .  .  .  .  |",
        "|8  | .  .  .  .  .  .  2t .  .  .  .  .  .  .  |",
        "|9  | .  .  .  .  .  .  2b .  .  .  .  .  .  .  |",
        "|10 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|11 | .  .  .  .  .  .  1a .  .  .  .  .  .  .  |",
        "|12 | .  .  .  .  .  .  1aC.  .  .  .  .  .  .  |",
        "|13 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "+-----------------------------------------------+"
    ];

    var world = new World();

    Util.setupWorld(test, world, map, world.players[0].id, Config.ATTACK_PHASE);
    Util.testWhereCanAttack(test, world, [6, 11],
        [[6, 0], [6, 2], [6, 5], [6, 7], [6, 8], [6, 9]],
        [[6, 1], [6, 3], [6, 4], [6, 6], [6, 10], [6, 13],
            [0, 11], [1, 11], [2, 11], [3, 11], [4, 11], [5, 11], [7, 11], [8, 11], [9, 11], [10, 11], [11, 11], [12, 11], [13, 11]]
    );

    test.done();
};<commit_msg>tests attack<commit_after>var World = require('../world');
var Config = require('../../shared/config.js');
var Util = require('../test_util.js');

exports.testAttackTorpedo01 = function(test) {

    var map = [
        "+-----------------------------------------------+",
        "|   | 0  1  2  3  4  5  6  7  8  9  10 11 12 13 |",
        "|---+-------------------------------------------|",
        "|0  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|1  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|2  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|3  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|4  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|5  | .  .  .  .  .  .  .  .  .  .  2p .  .  .  |",
        "|6  | .  .  .  .  .  .  .  1v 1t .  .  2p .  .  |",
        "|7  | .  .  .  .  .  .  .  .  .  .  2p .  .  .  |",
        "|8  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|9  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|10 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|11 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|12 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|13 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "+-----------------------------------------------+"
    ];

    var world = new World();

    Util.setupWorld(test, world, map, world.players[0].id, Config.ATTACK_PHASE);
    Util.testWhereCanAttack(test, world, [7, 6], [], [[7, 5], [7, 7], [6, 6], [8, 6]]);
    Util.testWhereCanAttack(test, world, [8, 6], [[10, 5], [10, 7], [11, 6]], []);

    test.done();
};

exports.testAttackTorpedo02 = function(test) {

    var map = [
        "+-----------------------------------------------+",
        "|   | 0  1  2  3  4  5  6  7  8  9  10 11 12 13 |",
        "|---+-------------------------------------------|",
        "|0  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|1  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|2  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|3  | .  .  .  .  .  .  .  2s .  .  .  .  .  .  |",
        "|4  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|5  | .  .  .  .  .  .  .  1t .  .  .  .  .  .  |",
        "|6  | .  .  .  2fM.  .  1t 1v 1t .  .  2p .  .  |",
        "|7  | .  .  .  .  .  .  .  1t .  .  2p .  .  .  |",
        "|8  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|9  | .  .  .  .  .  .  2B .  .  .  .  .  .  .  |",
        "|10 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|11 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|12 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|13 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "+-----------------------------------------------+"
    ];

    var world = new World();

    Util.setupWorld(test, world, map, world.players[0].id, Config.ATTACK_PHASE);
    Util.testWhereCanAttack(test, world, [7, 6], [], [[7, 5], [7, 7], [6, 6], [8, 6]]);
    Util.testWhereCanAttack(test, world, [8, 6], [[10, 7], [11, 6]], [[10, 5]]);
    Util.testWhereCanAttack(test, world, [6, 6], [[3, 6]], [[4, 5], [4, 7]]);
    Util.testWhereCanAttack(test, world, [7, 5], [], [[7, 2], [6, 3], [8, 3]]);
    Util.testWhereCanAttack(test, world, [7, 7], [[6, 9]], [[7, 10], [8, 9]]);

    test.done();
};

exports.testAttackAirplain01 = function(test) {

    var map = [
        "+-----------------------------------------------+",
        "|   | 0  1  2  3  4  5  6  7  8  9  10 11 12 13 |",
        "|---+-------------------------------------------|",
        "|0  | .  .  .  .  .  .  2B .  .  .  .  .  .  .  |",
        "|1  | .  .  .  .  .  .  1p .  .  .  .  .  .  .  |",
        "|2  | .  .  .  .  .  .  2p .  .  .  .  .  .  .  |",
        "|3  | .  .  .  .  .  1s .  .  .  .  .  .  .  .  |",
        "|4  | .  .  .  .  .  2s .  .  .  .  .  .  .  .  |",
        "|5  | .  .  .  .  .  .  2b .  .  .  .  .  .  .  |",
        "|6  | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|7  | .  .  .  .  .  .  2fS.  .  .  .  .  .  .  |",
        "|8  | .  .  .  .  .  .  2t .  .  .  .  .  .  .  |",
        "|9  | .  .  .  .  .  .  2b .  .  .  .  .  .  .  |",
        "|10 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "|11 | .  .  .  .  .  .  1a .  .  .  .  .  .  .  |",
        "|12 | .  .  .  .  .  .  1aC.  .  .  .  .  .  .  |",
        "|13 | .  .  .  .  .  .  .  .  .  .  .  .  .  .  |",
        "+-----------------------------------------------+"
    ];

    var world = new World();

    Util.setupWorld(test, world, map, world.players[0].id, Config.ATTACK_PHASE);
    Util.testWhereCanAttack(test, world, [6, 11],
        [[6, 0], [6, 2], [6, 5], [6, 7], [6, 8], [6, 9]],
        [[6, 1], [6, 3], [6, 4], [6, 6], [6, 10], [6, 12], [6, 13],
            [0, 11], [1, 11], [2, 11], [3, 11], [4, 11], [5, 11], [7, 11], [8, 11], [9, 11], [10, 11], [11, 11], [12, 11], [13, 11]]
    );

    test.done();
};
{'fraction_non_alphanumeric': 0.3503339404978749, 'fraction_numerical': 0.05737704918032787, 'mean_word_length': 0.5432542161149282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7218297', 'n_tokens_mistral': 5011, 'n_tokens_neox': 4644, 'n_words': 581}