<commit_before>var React = require('react');
var GridUtil = require('./gridUtil');

var style = {
    cellDead:{
        width:10,
        height:10,
        backgroundColor: 'white',
        float:'left'
    },
    cellAlive:{
        width:10,
        height:10,
        backgroundColor: 'black',
        float:'left'
    }
};

var width = 50;
var height = 50;

var GameApp = React.createClass({
        getInitialState: function(){
            return {
                grid:GridUtil.initializeGrid(width,height)
            }
        },

        componentDidMount: function(){
            setInterval(this._updateGrid, 1000);
        },

        _updateGrid: function(){
            this.setState({
                grid: GridUtil.calculateNextGenerationForGrid(this.state.grid)
            })
        },

        render: function () {
            return (<div style={{border: "1px red"}}>
                    {this.state.grid.map(function(row){
                        return (<div style={{height:10}}>{row.map(function(cell){
                            if(cell){
                                return <div style={style.cellAlive}></div>
                            }else{
                                return <div style={style.cellDead}></div>
                            }
                        })}</div>)
                    })}
                </div>
            );
        }
    }
);

React.render(<GameApp/>, document.getElementById('main'));
<commit_msg>start button<commit_after>var React = require('react');
var GridUtil = require('./gridUtil');

var style = {
    cellDead:{
        width:10,
        height:10,
        backgroundColor: 'white',
        float:'left'
    },
    cellAlive:{
        width:10,
        height:10,
        backgroundColor: 'black',
        float:'left'
    }
};

var width = 75;
var height = 75;

var GameApp = React.createClass({
        getInitialState: function(){
            return {
                grid:GridUtil.initializeGrid(width,height),
                active: false
            }
        },

        componentDidMount: function(){
            setInterval(this._updateGrid, 1);
        },

        _updateGrid: function(){

            if(this.state.active){
                this.setState({
                    grid: GridUtil.calculateNextGenerationForGrid(this.state.grid)
                });
            }
        },

        _start: function(){
            this.setState({
                active: true
            })
        },

        render: function () {
            return (<div>
                    <button onClick={this._start}>Start</button>
                    {this.state.grid.map(function(row){
                        return (<div style={{height:10}}>{row.map(function(cell){
                            if(cell){
                                return <div style={style.cellAlive}></div>
                            }else{
                                return <div style={style.cellDead}></div>
                            }
                        })}</div>)
                    })}
                </div>
            );
        }
    }
);

React.render(<GameApp/>, document.getElementById('main'));

{'fraction_non_alphanumeric': 0.12834224598930483, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 1.2473498233215548, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '565036', 'n_tokens_mistral': 854, 'n_tokens_neox': 797, 'n_words': 138}