<commit_before>
require('babel-core/register');

const ROT = require('../lib/rot');
const RG = require('../client/src/battles');
const MapMiner = require('../lib/map.miner');

const cols = 100;
const rows = 100;

// ROT.RNG.setSeed(1524319401126);
// const dontDig = {ulx: 1, uly: 1, lrx: 20, lry: 20};
const opts = {
    maxMinersCreated: 100,
    // dontDig
    // dirWeights: {NE: 1, SE: 1, SW: 1, NW: 1}
    // dirWeights: {N: 1, S: 1, E: 1, W: 1}
    dirWeights: {NE: 1, E: 10, SE: 5, S: 10},
    /* dirWeights: {
        N: 1, NE: 1, E: 2, SE: 1, S: 1, SW: 1, W: 20, NW: 1
    }*/
    addMiners: [
        {x: 1, y: rows - 2,
            dirWeights: {SE: 1, E: 10, NE: 5, N: 10}
        },
        {x: cols - 2, y: 1,
            dirWeights: {NW: 1, W: 10, SW: 5, S: 10}
        },
        {x: cols - 2, y: rows - 2,
            dirWeights: {SW: 1, W: 10, NW: 5, N: 10}
        }
    ],
    startX: 1, startY: 1
};

for (let i = 0; i < 10; i++) {

    const gen = new MapMiner(cols, rows, opts);
    const map = new RG.Map.CellList(cols, rows);

    gen.create((x, y, val) => {
        if (val === 1) {
            map.setBaseElemXY(x, y, RG.ELEM.WALL);
        }
        else {
            map.setBaseElemXY(x, y, RG.ELEM.FLOOR);
        }
    });

    map.debugPrintInASCII();

    console.log(JSON.stringify(gen._hist));
    console.log('seed was: ' + ROT.RNG.getSeed());

}<commit_msg>Added default params for different miners.<commit_after>
require('babel-core/register');

const ROT = require('../lib/rot');
const RG = require('../client/src/battles');
const MapMiner = require('../lib/map.miner');

const cols = 100;
const rows = 100;

const midX = Math.round(cols / 2);
const midY = Math.round(rows / 2);


const miners = {
    N: {x: midX, y: 1, dirWeights: {E: 1, W: 1, S: 5, SE: 5, SW: 5}},
    S: {x: midX, y: rows - 2, dirWeights: {E: 1, W: 1, N: 5, NE: 5, NW: 5}},
    E: {x: cols - 2, y: midY, dirWeights: {N: 1, S: 1, NW: 5, W: 5, SW: 5}},
    W: {x: 1, y: midY, dirWeights: {N: 1, S: 1, NE: 5, E: 5, SE: 5}},
    NE: {x: cols - 2, y: 1, dirWeights: {NW: 1, W: 10, SW: 5, S: 10}},
    NW: {x: 1, y: 1, dirWeights: {NE: 1, E: 10, SE: 5, S: 10}},
    SE: {x: cols - 2, y: rows - 2, dirWeights: {SW: 1, W: 10, NW: 5, N: 10}},
    SW: {x: 1, y: rows - 2, dirWeights: {SE: 1, E: 10, NE: 5, N: 10}},
    C: {
        x: midX, y: midY,
        dirWeights: {N: 1, S: 1, E: 1, W: 1, NE: 5, SE: 10, NW: 1, SW: 1}
    }
};

// const dirs = Object.keys(miners);
const minerValues = Object.values(miners);


// ROT.RNG.setSeed(1524319401126);
// const dontDig = {ulx: 1, uly: 1, lrx: 20, lry: 20};

for (let i = 0; i < 10; i++) {

    const opts = getRandOpts();
    const gen = new MapMiner(cols, rows, opts);
    const map = new RG.Map.CellList(cols, rows);

    gen.create((x, y, val) => {
        if (val === 1) {
            map.setBaseElemXY(x, y, RG.ELEM.WALL);
        }
        else {
            map.setBaseElemXY(x, y, RG.ELEM.FLOOR);
        }
    });

    map.debugPrintInASCII();

    console.log(JSON.stringify(gen._hist));
    console.log('seed was: ' + ROT.RNG.getSeed());

}

function getRandOpts() {
    const nMiners = RG.RAND.getUniformInt(1, 9);
    const firstMiner = RG.RAND.arrayGetRand(minerValues);
    const opts = {
        startX: firstMiner.x, startY: firstMiner.y,
        dirWeights: firstMiner.dirWeights
    };
    const addMiners = [];
    for (let i = 0; i < nMiners - 1; i++) {
        const extraMiner = RG.RAND.arrayGetRand(minerValues);
        addMiners.push(extraMiner);
    }

    opts.addMiners = addMiners;
    return opts;
}

const Conf = {};

function getMinersCorners() {
    const minersCorners = {
        cols: 100, rows: 100,
        maxMinersCreated: 100,
        dirWeights: miners.NW.dirWeights,
        addMiners: [
            miners.SW,
            miners.NE,
            miners.SE
        ],
        startX: miners.NW.x, startY: miners.NW.y
    };
    console.log(minersCorners);
    return minersCorners;
}
Conf.getMinersCorners = getMinersCorners;

function getMinersNSEW() {
    const minersNSEW = {
        cols: 100, rows: 100,
        maxMinersCreated: 100,

        startX: miners.N.x, startY: miners.N.y,
        dirWeights: miners.N.dirWeights,

        addMiners: [
            miners.S,
            miners.E,
            miners.W
        ]
    };
    return minersNSEW;
}
Conf.getMinersNSEW = getMinersNSEW;
{'fraction_non_alphanumeric': 0.1787098244814224, 'fraction_numerical': 0.04536129473444267, 'mean_word_length': 2.154565061107117, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '4079323', 'n_tokens_mistral': 2017, 'n_tokens_neox': 1763, 'n_words': 483}