<commit_before>/* 
    GAME

    the view for the actual gameplay
    includes mouse listeners for clicking balls and for pause button
*/

function Game() {
    var difficulty = 1;
    var score = 0;

    var theta = -Math.PI/2;
    var phi = Math.PI/2;
    var camCenter = [0.0, 5.0, 0.0];
    var camR = 180.0;
    
    var mass = 0.00001;
    var shapes = [];
    var now = new Date();
    this.isPaused = true;
    
    var pixels = new Uint8Array(4);

    rule = 0;

    var gameRules = [];

    gameRules.push({'rule':'Multiples of 2',
                    'check': var check = function(index) {
                        if (shapes[index].number % 2 == 0)
                        { return true; }
                        return false;
                    }};

	var ruleText = document.getElementById("SelectedElem");
    ruleText.innerHTML = currentState.gameRules[rule]['rule'];

    //TODO make sure to free this
    this.removeShape = function (index) {
        // removes this object from rendering
        if (typeof shapes[index] !== 'undefined'  )
        {
            dynamicsWorld.removeRigidBody(shapes[index].body);
            shapes.splice(index,1);
        }
    }<commit_msg>it got 99 problems but a rule aint one<commit_after>/* 
    GAME

    the view for the actual gameplay
    includes mouse listeners for clicking balls and for pause button
*/

function Game() {
    var difficulty = 1;
    var score = 0;

    var theta = -Math.PI/2;
    var phi = Math.PI/2;
    var camCenter = [0.0, 5.0, 0.0];
    var camR = 180.0;
    
    var mass = 0.00001;
    var shapes = [];
    var now = new Date();
    this.isPaused = true;
    
    var pixels = new Uint8Array(4);

    rule = 0;

    var gameRules = [];

    gameRules.push({'rule':'Multiples of 2',
                    'check': function(index) {
                        if (typeof( shapes[index]) == undefined) 
                        {
                            return false;
                        }
                        if (shapes[index].number % 2 == 0)
                        { return true; }
                        return false;
                        }
                    });

	var ruleText = document.getElementById("SelectedElem");
    ruleText.innerHTML = gameRules[rule]['rule'];

    //TODO make sure to free this
    this.removeShape = function (index) {
        // removes this object from rendering
        if (typeof shapes[index] !== 'undefined'  )
        {
            dynamicsWorld.removeRigidBody(shapes[index].body);
            shapes.splice(index,1);
        }
    }
{'fraction_non_alphanumeric': 0.1125776397515528, 'fraction_numerical': 0.021739130434782608, 'mean_word_length': 1.5718562874251496, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590563', 'n_tokens_mistral': 792, 'n_tokens_neox': 717, 'n_words': 210}