<commit_before>var bits = 0;
var bitsMax = 8;
var bytes = 0;
var bytesMax = 8;
var drives = 0;
var driveCost = 8;

function bitsClick(number){
    if(bits >= bitsMax) return;
    bits = bits + number;
    update("bits",bits);
    progBar("bitsbar",bits,bitsMax);
};

function bytesClick(number){
    if(bytes >= bytesMax || bits < 8) return;
    bytes = bytes + number;
    bits = bits - 8;
    update("bits",bits);
    update("bytes",bytes);
    progBar("bitsbar",bits,bitsMax);
    progBar("bytesbar",bytes,bytesMax);
};

function buyDrive(){
    if(bits >= driveCost){
        drives = drives + 1;
        bits = bits - driveCost;
        bitsMax = bitsMax + 8;
        update("drives",drives);
        update("bits",bits);
        update("bitsMax",bitsMax);
        progBar("bitsbar",bits,bitsMax);
    }
};

function progBar(bar,amt,amtMax){
    var myProg = document.getElementById("myProgress");
    var myBar = document.getElementById(bar);
    var percent = Math.floor((amt/amtMax)*100);
    myProg.style.width = amtMax;
    myBar.style.width = percent + '%';
    if(percent <= 33) {myBar.style['background-color'] = "red"};
    if(percent >= 34 && percent <= 66) {myBar.style['background-color'] = "yellow"};
    if(percent >= 67) {myBar.style['background-color'] = "green"};
};

function update(what,number){
    document.getElementById(what).innerHTML = number;
};<commit_msg>Update main.js<commit_after>var bits = 0;
var bitsMax = 8;
var bytes = 0;
var bytesMax = 8;
var bitsdrives = 0;
var bitsdriveCost = 8;

function bitsClick(number){
    if(bits >= bitsMax) return;
    bits = bits + number;
    update("bits",bits);
    progBar("bitsbar",bits,bitsMax);
};

function bytesClick(number){
    if(bytes >= bytesMax || bits < 8) return;
    bytes = bytes + number;
    bits = bits - 8;
    update("bits",bits);
    update("bytes",bytes);
    progBar("bitsbar",bits,bitsMax);
    progBar("bytesbar",bytes,bytesMax);
};

function buybitsDrive(){
    if(bits >= bitsdriveCost){
        bitsdrives = bitsdrives + 1;
        bits = bits - bitsdriveCost;
        bitsMax = bitsMax + 8;
        update("bitsdrives",bitsdrives);
        update("bits",bits);
        update("bitsMax",bitsMax);
        progBar("bitsbar",bits,bitsMax);
    }
};

function progBar(bar,amt,amtMax){
    var myProg = document.getElementById("myProgress");
    var myBar = document.getElementById(bar);
    var percent = Math.floor((amt/amtMax)*100);
    myProg.style.width = amtMax;
    myBar.style.width = percent + '%';
    if(percent <= 33) {myBar.style['background-color'] = "red"};
    if(percent >= 34 && percent <= 66) {myBar.style['background-color'] = "yellow"};
    if(percent >= 67) {myBar.style['background-color'] = "green"};
};

function update(what,number){
    document.getElementById(what).innerHTML = number;
};
{'fraction_non_alphanumeric': 0.16743690010664772, 'fraction_numerical': 0.014930678990401706, 'mean_word_length': 3.575609756097561, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '5153765', 'n_tokens_mistral': 971, 'n_tokens_neox': 912, 'n_words': 191}