<commit_before>function Gobang(canvasDOM, rows, cols) {
    function Background(rows, cols) {
        this.rows = rows;
        this.cols = cols;
        this.draw = function() {
            this.canvas.fillStyle = "rgb(208, 141, 47)";
            this.canvas.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
            this.canvas.fillStyle = "#000000";

            this.canvas.beginPath();
            var cellWidth = this.canvasWidth / (this.cols + 1);
            var cellHeight = this.canvasHeight / (this.rows + 1);
            for (var i = 1; i <= this.cols; i++) {
                this.canvas.moveTo(cellWidth * i, cellHeight);
                this.canvas.lineTo(cellWidth * i, this.canvasHeight - cellHeight);
            }
            for (var i = 1; i <= this.rows; i++) {
                this.canvas.moveTo(cellWidth, cellHeight * i);
                this.canvas.lineTo(this.canvasWidth - cellWidth, cellHeight * i);
            }
            this.canvas.closePath();
            this.canvas.stroke();
        }
    }

    function StonePool(rows, cols) {
        this.draw = function(currentPlayer) {
            var white = (currentPlayer == 0);
            var radius = this.game.cellWidth + this.game.cellHeight;
            radius /= 4;
            this.canvas.fillStyle = white ? '#fff' : '#000';
            for (var i = this.moves.length - 1; i >= 0; i--) {
                this.canvas.fillStyle = currentPlayer == 0 ? "#000" : "#fff";
                this.canvas.beginPath();
                this.canvas.arc(this.moves[i][1] * this.game.cellWidth + this.game.cellWidth,
                        this.moves[i][0] * this.game.cellHeight + this.game.cellHeight,
                        radius, 0, 2 * Math.PI);
                this.canvas.closePath();
                this.canvas.fill();
                currentPlayer = 1 - currentPlayer;
            }
        }
    }

    /* utils */
    this.inBoard = function (row, col) {
        return row >= 0 && col >= 0 && row < this.rows && col < this.cols;
    }

    this.rows = rows ? rows : 19;
    this.cols = cols ? cols : 19;

    this.currentPlayer = 0;
    this.moves = [];
    this.grid = new Array(this.rows);
    for (var i = 0; i < this.rows; i++) 
        this.grid[i] = new Array(this.cols);

    this.newMove = function(row, col, isAI) {
        if (this.grid[row][col] != -1) return;
        this.grid[row][col] = this.currentPlayer;<commit_msg>Change default size to 15 * 15<commit_after>function Gobang(canvasDOM, rows, cols) {
    function Background(rows, cols) {
        this.rows = rows;
        this.cols = cols;
        this.draw = function() {
            this.canvas.fillStyle = "rgb(208, 141, 47)";
            this.canvas.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
            this.canvas.fillStyle = "#000000";

            this.canvas.beginPath();
            var cellWidth = this.canvasWidth / (this.cols + 1);
            var cellHeight = this.canvasHeight / (this.rows + 1);
            for (var i = 1; i <= this.cols; i++) {
                this.canvas.moveTo(cellWidth * i, cellHeight);
                this.canvas.lineTo(cellWidth * i, this.canvasHeight - cellHeight);
            }
            for (var i = 1; i <= this.rows; i++) {
                this.canvas.moveTo(cellWidth, cellHeight * i);
                this.canvas.lineTo(this.canvasWidth - cellWidth, cellHeight * i);
            }
            this.canvas.closePath();
            this.canvas.stroke();
        }
    }

    function StonePool(rows, cols) {
        this.draw = function(currentPlayer) {
            var white = (currentPlayer == 0);
            var radius = this.game.cellWidth + this.game.cellHeight;
            radius /= 4;
            this.canvas.fillStyle = white ? '#fff' : '#000';
            for (var i = this.moves.length - 1; i >= 0; i--) {
                this.canvas.fillStyle = currentPlayer == 0 ? "#000" : "#fff";
                this.canvas.beginPath();
                this.canvas.arc(this.moves[i][1] * this.game.cellWidth + this.game.cellWidth,
                        this.moves[i][0] * this.game.cellHeight + this.game.cellHeight,
                        radius, 0, 2 * Math.PI);
                this.canvas.closePath();
                this.canvas.fill();
                currentPlayer = 1 - currentPlayer;
            }
        }
    }

    /* utils */
    this.inBoard = function (row, col) {
        return row >= 0 && col >= 0 && row < this.rows && col < this.cols;
    }

    this.rows = rows ? rows : 15;
    this.cols = cols ? cols : 15;

    this.currentPlayer = 0;
    this.moves = [];
    this.grid = new Array(this.rows);
    for (var i = 0; i < this.rows; i++) 
        this.grid[i] = new Array(this.cols);

    this.newMove = function(row, col, isAI) {
        if (this.grid[row][col] != -1) return;
        this.grid[row][col] = this.currentPlayer;
{'fraction_non_alphanumeric': 0.1437948717948718, 'fraction_numerical': 0.019282051282051283, 'mean_word_length': 1.6835443037974684, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '3970299', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1455, 'n_words': 324}