<commit_before>const slice = (() => {
    const splitAt = (array, n) => [array.slice(0, n), array.slice(n)];
    const reduceConcat = a => a.length ? a.reduce((a, b) => [a].concat(reduceConcat(b))) : [];

    return (array, n) => {
        const splitted = splitAt(array, n);
        var p = splitted;
        while (p[1].length !== 0) {
            p[1] = splitAt(p[1], n);
            p = p[1];
        }
        return reduceConcat(splitted);
    };
})();

/**
 * manage each number cell by the object
 * {
 *   type:: String, -- 'given' if number is given, or 'free'.
 *   value:: Number | Array, -- Number if type === 'given', or Array of memo values.
 * }
 */
const rootVm = new Vue({
    el: '#app-sudoku',
    template: `
    <div class="boxes">
        <div class="box-row" v-for="span in [[0, 3], [3, 6], [6, 9]]">
            <div class="box" v-for="values in boxes.slice(span[0], span[1])">
                <div class="row-in-box" v-for="span in [[0, 3], [3, 6], [6, 9]]">
                    <span v-for="cell in values.slice(span[0], span[1])" class="cell">
                        <span v-if="cell.type === 'given'" class="given">{{ cell.value }}</span>
                        <div  v-else class="memo" v-for="memo in slice(cell.value, 3)">
                            <span v-for="n in memo">{{ n }}</span>
                        </div>
                    </span>
                </div>
            </div>
        </div>
    </div>`,
    created: function() {
        const makeCellObject = n => n ? { type: 'given', value: n, } : { type: 'free', value: [1,2,3,4,5,6,7,8,9,], };
        const rows = slice(Array.from(this.board).map(Number).map(makeCellObject), 9);
        this.rows = rows;

        const sliced = rows.map(row => slice(row, 3));
        this.boxes = [
            [].concat(sliced[0][0], sliced[1][0], sliced[2][0]),
            [].concat(sliced[0][1], sliced[1][1], sliced[2][1]),
            [].concat(sliced[0][2], sliced[1][2], sliced[2][2]),
            
            [].concat(sliced[3][0], sliced[4][0], sliced[5][0]),
            [].concat(sliced[3][1], sliced[4][1], sliced[5][1]),
            [].concat(sliced[3][2], sliced[4][2], sliced[5][2]),

            [].concat(sliced[6][0], sliced[7][0], sliced[8][0]),
            [].concat(sliced[6][1], sliced[7][1], sliced[8][1]),
            [].concat(sliced[6][2], sliced[7][2], sliced[8][2]),
        ];
    },
    data: () => new Object({
        board: '060003001200500600007090500000400090800000006010005000002010700004009003700200040', // 朝日新聞beパズル 2017/10/07 掲載分
        rows: undefined,
        boxes: undefined,
    }),
    methods: {<commit_msg>Remove rows from reactive data.<commit_after>const slice = (() => {
    const splitAt = (array, n) => [array.slice(0, n), array.slice(n)];
    const reduceConcat = a => a.length ? a.reduce((a, b) => [a].concat(reduceConcat(b))) : [];

    return (array, n) => {
        const splitted = splitAt(array, n);
        var p = splitted;
        while (p[1].length !== 0) {
            p[1] = splitAt(p[1], n);
            p = p[1];
        }
        return reduceConcat(splitted);
    };
})();

/**
 * manage each number cell by the object
 * {
 *   type:: String, -- 'given' if number is given, or 'free'.
 *   value:: Number | Array, -- Number if type === 'given', or Array of memo values.
 * }
 */
const rootVm = new Vue({
    el: '#app-sudoku',
    template: `
    <div class="boxes">
        <div class="box-row" v-for="span in [[0, 3], [3, 6], [6, 9]]">
            <div class="box" v-for="values in boxes.slice(span[0], span[1])">
                <div class="row-in-box" v-for="span in [[0, 3], [3, 6], [6, 9]]">
                    <span v-for="cell in values.slice(span[0], span[1])" class="cell">
                        <span v-if="cell.type === 'given'" class="given">{{ cell.value }}</span>
                        <div  v-else class="memo" v-for="memo in slice(cell.value, 3)">
                            <span v-for="n in memo">{{ n }}</span>
                        </div>
                    </span>
                </div>
            </div>
        </div>
    </div>`,
    created: function() {
        const makeCellObject = n => n ? { type: 'given', value: n, } : { type: 'free', value: [1,2,3,4,5,6,7,8,9,], };
        const rows = slice(Array.from(this.board).map(Number).map(makeCellObject), 9);
        const sliced = rows.map(row => slice(row, 3));
        this.boxes = [
            [].concat(sliced[0][0], sliced[1][0], sliced[2][0]),
            [].concat(sliced[0][1], sliced[1][1], sliced[2][1]),
            [].concat(sliced[0][2], sliced[1][2], sliced[2][2]),
            
            [].concat(sliced[3][0], sliced[4][0], sliced[5][0]),
            [].concat(sliced[3][1], sliced[4][1], sliced[5][1]),
            [].concat(sliced[3][2], sliced[4][2], sliced[5][2]),

            [].concat(sliced[6][0], sliced[7][0], sliced[8][0]),
            [].concat(sliced[6][1], sliced[7][1], sliced[8][1]),
            [].concat(sliced[6][2], sliced[7][2], sliced[8][2]),
        ];
    },
    data: () => new Object({
        board: '060003001200500600007090500000400090800000006010005000002010700004009003700200040', // 朝日新聞beパズル 2017/10/07 掲載分
        boxes: undefined,
    }),
    methods: {
{'fraction_non_alphanumeric': 0.21808510638297873, 'fraction_numerical': 0.06724924012158055, 'mean_word_length': 2.1246290801186944, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '444693', 'n_tokens_mistral': 2065, 'n_tokens_neox': 1852, 'n_words': 392}