<commit_before>var colors = {
    RED: 0,
    BLUE: 1,
    NEUTRAL: 2,
    ASSASSIN: 3,
    DEFAULT: 4,
    NUMCOLORS: 5
};
var colorNames = ["Red", "Blue", "Neutral", "Assassin", "Default", "NumColors"];
var cssColors = ["Crimson", "SteelBlue", "Wheat", "DimGray", "Cornsilk"];

var seed;
var wordList = [];
var answerList = [];
var startColor;
var gameSize = 25;
var seedLength = 5;
var enableInvertedText = false;

<!-- Load the updateText on first load for now -->
window.onload = function() {
    newSeed();
    newGame();
};

function stringSeedToInt(stringSeed) {
    return parseInt(stringSeed, 36);
}

function intSeedToString(intSeed) {
    return intSeed.toString(36);
}

String.prototype.replaceAt=function(index, character) {
    return this.substr(0, index) + character + this.substr(index+character.length);
}

function incrementSeed() {  
    var stringSeed = intSeedToString(seed);
    for(i = seedLength - 1; i >= 0; i--) {
        var c = String.fromCharCode(stringSeed.charCodeAt(i) + 1);
        if(c == "{") {
            c = "a";
            stringSeed = stringSeed.replaceAt(i, c);
        }
        else {
            stringSeed = stringSeed.replaceAt(i, c);
            break;
        }
    }
    
    seed = stringSeedToInt(stringSeed);    
}

function newSeed() {
    var tempSeed = "";
    var a = "a".charCodeAt(0);
    var alphabetSize = 26;
    
    Math.seedrandom();

    for(var i = 0; i < seedLength; ++i)
    {
        var offset = Math.floor(alphabetSize * Math.random());
        tempSeed += String.fromCharCode(a + offset);
    }
        
    var intSeed = stringSeedToInt(tempSeed);
    seed = intSeed;
    
    while(seed % 16) {
        incrementSeed();
    }
}

function loadGame() {
    var loadSeed = prompt("Please enter a Game ID");
    if(loadSeed == undefined) {
        return;
    }
    var regString = "^[a-z]{" + seedLength + "}$";
    var re = new RegExp(regString);
    var match = loadSeed.match(re);
    
    if(match == null) {
        alert("'" + loadSeed + "' is not a valid seed");
    } else {
        var intSeed = stringSeedToInt(loadSeed);
        seed = intSeed;
        generateGame();
    }
}

function newGame() {<commit_msg>Rename seed to Game ID<commit_after>var colors = {
    RED: 0,
    BLUE: 1,
    NEUTRAL: 2,
    ASSASSIN: 3,
    DEFAULT: 4,
    NUMCOLORS: 5
};
var colorNames = ["Red", "Blue", "Neutral", "Assassin", "Default", "NumColors"];
var cssColors = ["Crimson", "SteelBlue", "Wheat", "DimGray", "Cornsilk"];

var seed;
var wordList = [];
var answerList = [];
var startColor;
var gameSize = 25;
var seedLength = 5;
var enableInvertedText = false;

<!-- Load the updateText on first load for now -->
window.onload = function() {
    newSeed();
    newGame();
};

function stringSeedToInt(stringSeed) {
    return parseInt(stringSeed, 36);
}

function intSeedToString(intSeed) {
    return intSeed.toString(36);
}

String.prototype.replaceAt=function(index, character) {
    return this.substr(0, index) + character + this.substr(index+character.length);
}

function incrementSeed() {  
    var stringSeed = intSeedToString(seed);
    for(i = seedLength - 1; i >= 0; i--) {
        var c = String.fromCharCode(stringSeed.charCodeAt(i) + 1);
        if(c == "{") {
            c = "a";
            stringSeed = stringSeed.replaceAt(i, c);
        }
        else {
            stringSeed = stringSeed.replaceAt(i, c);
            break;
        }
    }
    
    seed = stringSeedToInt(stringSeed);    
}

function newSeed() {
    var tempSeed = "";
    var a = "a".charCodeAt(0);
    var alphabetSize = 26;
    
    Math.seedrandom();

    for(var i = 0; i < seedLength; ++i)
    {
        var offset = Math.floor(alphabetSize * Math.random());
        tempSeed += String.fromCharCode(a + offset);
    }
        
    var intSeed = stringSeedToInt(tempSeed);
    seed = intSeed;
    
    while(seed % 16) {
        incrementSeed();
    }
}

function loadGame() {
    var loadSeed = prompt("Please enter a Game ID");
    if(loadSeed == undefined) {
        return;
    }
    var regString = "^[a-z]{" + seedLength + "}$";
    var re = new RegExp(regString);
    var match = loadSeed.match(re);
    
    if(match == null) {
        alert("'" + loadSeed + "' is not a valid Game ID");
    } else {
        var intSeed = stringSeedToInt(loadSeed);
        seed = intSeed;
        generateGame();
    }
}

function newGame() {
{'fraction_non_alphanumeric': 0.14675147660154475, 'fraction_numerical': 0.010449795547478418, 'mean_word_length': 2.5167731629392973, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2582960', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1512, 'n_words': 355}