<commit_before>function createWebSocket(path) {
    var host = window.location.hostname;
    if(host == '') host = 'localhost';
    var uri = 'ws://' + host + ':3000' + path;
    var Socket = WebSocket           // "MozWebSocket" in window ? MozWebSocket : WebSocket;
    return new Socket(uri);
    connect("/",{
        "connect timeout": 36000,
        "reconnect": false
    });
}
var ws;
var users = [];
var ar = [];
var bool = [];
var createFunctions;
var createDom;
var createOperators;
var createDropboxes;
var createDrop1;
var createDrop2;
var timer;
var refreshDropboxes;
var populate;
var refresh;
var calc;
var sub1;
var sub2;

function makeDS_ob() {
    this.t = -1,
    this.privateClicker = "a@F$Uy&private";
    this.player = "<NAME>";
    this.impossibleClicker = "<NAME>";
    this.scoreClicker = "Beaming Banana" ;
    this.rollText = "1,1,1,1,42"
    this.d = -1;
    this.ar = [];
    this.bool = [];
    this.game = "off";
    this.scoreFunc = function() {
        $("#countdown").html("");
        $("#a0").html("");
        if (this.player === this.scoreClicker) {
            ws.send("CL#$42," + this.privateClicker + "," + this.player + "," + "dummy");
        }
        if ( this.player === this.impossibleClicker) {
            ws.send("CM#$42,"+ this.privateClicker + "," + this.player + "," + "dummy");
            $("#stop60").triggerHandler('click');
        }
    }
}
DS_ob = new makeDS_ob();
}

refresh = function() {
    DS_ob.game = "off";
    DS_ob.d = -1;
    DS_ob.scoreClicker = "a@F$Uy&score";
    DS_ob.impossibleClicker = "a@F$Uy&impossible";
    DS_ob.ar = [];
    DS_ob.bool = [];
    $("#a0").html("");
    $("#a2").html("");
    $("#a4").html("");
    createDom();
    createOperators();
    createDropboxes();
    $('.drag').draggable({ revert: "invalid", zIndex: 2 });
    $('.dragNew').draggable({ revert: "invalid", zIndex: 2 });
    $('.drag2').draggable({ helper: "clone", revert: "invalid", zIndex: 2 });
    createDrop1();
    createDrop2();
    $("#result1").hide();
    $("#result2").hide();
    $("#result3").hide();
    $("#rollA").show();
    $("#scoreF").hide();
    $("#impossibleJ").hide();
    $("#newDisplay").hide();
    $("#countdown").html("");
    $(".dropx").hide();
    $(".drop2x").hide();
    $(".drop").show();
    $(".drop2").show();
};

$(document).ready(function () {
    function assign (a, b, c, d, e, f) { 
        var res;
        $("#"+d).hide();
        $("#"+e).hide();
        $("#result" + f).show();
        switch (b) {
            case "+": res = parseFloat(a) + parseFloat(c);
            break;
            case "-": res = a - c;
            break;
            case "*": res = a * c;
            break;
            case "/": res = a / c;
            break;
            case "Concat": res = parseFloat(a+c);
            break;
        }
        $("#result" + f).html(res);
        $("#0").html(a);
        $("#1").html(b);
        $("#2").html(c);
    };
    function onMessage(event) {
        $("#go30").hide();
        $("#go60").hide();
        $("#stop30").hide();
        $("#stop60").show();
        var game = DS_ob.game;
        var impX = DS_ob.impossibleClicker;
        var plX = DS_ob.player;
        var scX = DS_ob.scoreClicker;
        var prX = DS_ob.privateClicker;
        var gameArray = event.data.split(",");
        var d2 = event.data.substring(0,6);
        var d3 = event.data.substring(2,6);
        var sourceStatus = gameArray[1];  // Value of sender's privateClicker
        var sender = gameArray[2];
        var extra = gameArray[3];
        var ext4= gameArray[4];
        var ext5 = gameArray[5];
        var ext6 = gameArray[6];
        var ext7 = gameArray[7];
        var ext8 = gameArray[8];
        var p = $(document.createElement('p')).text(event.data);
        if (plX === sender || prX !== "a@F$Uy&private" &&  sourceStatus !== "a@F$Uy&private") {
            switch (d2) {
                case "CA#$42":               // Set up the next round of play.
                    refresh();
                    $(".dropx").hide();
                    $(".drop2x").hide();
                    $(".drop").show();
                    $(".drop2").show();
                    $("#impossibleJ").show();
                    $("#scoreF").show();
                    $("#info1").html("");
                    $(".erase").show();
                    $("#show").show();
                    $("#show2").show();
                    $("#solutions").show();
                    $("#iutions2").show();
                    $("#a0").html("");
                    var auu = gameArray[3]
                    var buu = gameArray[4]
                    var cuu = gameArray[5]
                    var duu = gameArray[6]
                    rollText = auu + "," + buu + "," + cuu + "," + duu + "," + 42;
                    DS_ob.rollText = rollText;
                    DS_ob.d = -1;
                    populate(auu,buu,cuu,duu);
                    $("#a4").html(auu + " &nbsp; " + buu + " &nbsp; " + cuu + " &nbsp; " + duu);
                break;

                case "CB#$42":
                    $("#users").html(event.data.substring(6));    // Refresh browser with server state.
                break;

                case "CC#$42":
                    // Prevents new player login data from defaulting to a chat message.
                break;

                case "CD#$42":       // Prevent new player login data from displaying as a chat message.
                    if (sender !== player) {
                        $("#" + gameArray[3]).hide();
                        $("#" + gameArray[5]).val(gameArray[4]);
                        $("#" + gameArray[5]).html(gameArray[4]);
                    }
                break;

                case "CE#$42":
                    $("#a4").append(extra);  // Display computations.
                    $("#rollA").hide();
                    $("#newDisplay").show();
                    DS_ob.ar = [];
                break;

                case "CF#$42":
                    game = "on";
                    DS_ob.game = "on";
                    $("#a2").append("<br>" + sender + " clicked 'SCORE'");
                    DS_ob.ar = [];
                    $("#rollA").hide();
                    $("#newDisplay").show();
                    $("#scoreF").hide();
                    $('#go30').triggerHandler('click');
                    if (plX !== scX) {
                        $("#a0").append(scX + " clicked SCORE and must make the " +
                            "number '20' before time runs out.</h3>");
                        $("#newDisplay").hide();
                        $("#impossibleJ").hide();
                        $(".dropx").show();
                        $(".drop2x").show();
                        $(".drop").hide();
                        $(".drop2").hide();
                    }
                break;

                case "CG#$42":
                    $("#stop30").triggerHandler('click');
                    $("#a0").html("");
                    $("#a2").append("<br>One point for " + sender);
                    $("#a1").prepend("<span style='font-size:75px; background:#000; color:#f00;'>Score!</span>");
                    $("#newDisplay").show();
                    $("#countdown").html("");
                break;

                case "CH#$42":
                    if (plX !== sender && DS_ob.game === "on") {
                        assign (extra, ext4, ext5, ext6, ext7, ext8);
                        console.log("From CH#$42 " + extra, ext4, ext5, ext6, ext7, ext8)
                    }

                break;

                case "CK#$42":       // Prevent new player login data from displaying as a chat message.
                    if (sender !== player) {<commit_msg>Corrected an error.<commit_after>function createWebSocket(path) {
    var host = window.location.hostname;
    if(host == '') host = 'localhost';
    var uri = 'ws://' + host + ':3000' + path;
    var Socket = WebSocket           // "MozWebSocket" in window ? MozWebSocket : WebSocket;
    return new Socket(uri);
    connect("/",{
        "connect timeout": 36000,
        "reconnect": false
    });
}
var ws;
var users = [];
var ar = [];
var bool = [];
var createFunctions;
var createDom;
var createOperators;
var createDropboxes;
var createDrop1;
var createDrop2;
var timer;
var refreshDropboxes;
var populate;
var refresh;
var calc;
var sub1;
var sub2;

function makeDS_ob() {
    this.t = -1,
    this.privateClicker = "a@F$Uy&private";
    this.player = "<NAME>";
    this.impossibleClicker = "<NAME>";
    this.scoreClicker = "Beaming Banana" ;
    this.rollText = "1,1,1,1,42"
    this.d = -1;
    this.ar = [];
    this.bool = [];
    this.game = "off";
    this.scoreFunc = function() {
        $("#countdown").html("");
        $("#a0").html("");
        if (this.player === this.scoreClicker) {
            ws.send("CL#$42," + this.privateClicker + "," + this.player + "," + "dummy");
        }
        if ( this.player === this.impossibleClicker) {
            ws.send("CM#$42,"+ this.privateClicker + "," + this.player + "," + "dummy");
            $("#stop60").triggerHandler('click');
        }
    }
}
DS_ob = new makeDS_ob();
}

refresh = function() {
    DS_ob.game = "off";
    DS_ob.d = -1;
    DS_ob.scoreClicker = "a@F$Uy&score";
    DS_ob.impossibleClicker = "a@F$Uy&impossible";
    DS_ob.ar = [];
    DS_ob.bool = [];
    $("#a0").html("");
    $("#a2").html("");
    $("#a4").html("");
    createDom();
    createOperators();
    createDropboxes();
    $('.drag').draggable({ revert: "invalid", zIndex: 2 });
    $('.dragNew').draggable({ revert: "invalid", zIndex: 2 });
    $('.drag2').draggable({ helper: "clone", revert: "invalid", zIndex: 2 });
    createDrop1();
    createDrop2();
    $("#result1").hide();
    $("#result2").hide();
    $("#result3").hide();
    $("#rollA").show();
    $("#scoreF").hide();
    $("#impossibleJ").hide();
    $("#newDisplay").hide();
    $("#countdown").html("");
    $(".dropx").hide();
    $(".drop2x").hide();
    $(".drop").show();
    $(".drop2").show();
};

$(document).ready(function () {
    function assign (a, b, c, d, e, f) { 
        var res;
        $("#"+d).hide();
        $("#"+e).hide();
        $("#result" + f).show();
        switch (b) {
            case "+": res = parseFloat(a) + parseFloat(c);
            break;
            case "-": res = a - c;
            break;
            case "*": res = a * c;
            break;
            case "/": res = a / c;
            break;
            case "Concat": res = parseFloat(a+c);
            break;
        }
        $("#result" + f).html(res);
        $("#0").html(a);
        $("#1").html(b);
        $("#2").html(c);
    };
    function onMessage(event) {
        $("#go30").hide();
        $("#go60").hide();
        $("#stop30").hide();
        $("#stop60").show();
        var game = DS_ob.game;
        var impX = DS_ob.impossibleClicker;
        var plX = DS_ob.player;
        var scX = DS_ob.scoreClicker;
        var prX = DS_ob.privateClicker;
        var gameArray = event.data.split(",");
        var d2 = event.data.substring(0,6);
        var d3 = event.data.substring(2,6);
        var sourceStatus = gameArray[1];  // Value of sender's privateClicker
        var sender = gameArray[2];
        var extra = gameArray[3];
        var ext4= gameArray[4];
        var ext5 = gameArray[5];
        var ext6 = gameArray[6];
        var ext7 = gameArray[7];
        var ext8 = gameArray[8];
        var p = $(document.createElement('p')).text(event.data);
        if (plX === sender || prX !== "a@F$Uy&private" &&  sourceStatus !== "a@F$Uy&private") {
            switch (d2) {
                case "CA#$42":               // Set up the next round of play.
                    refresh();
                    $(".dropx").hide();
                    $(".drop2x").hide();
                    $(".drop").show();
                    $(".drop2").show();
                    $("#impossibleJ").show();
                    $("#scoreF").show();
                    $("#info1").html("");
                    $(".erase").show();
                    $("#show").show();
                    $("#show2").show();
                    $("#solutions").show();
                    $("#iutions2").show();
                    $("#a0").html("");
                    var auu = gameArray[3]
                    var buu = gameArray[4]
                    var cuu = gameArray[5]
                    var duu = gameArray[6]
                    rollText = auu + "," + buu + "," + cuu + "," + duu + "," + 42;
                    DS_ob.rollText = rollText;
                    DS_ob.d = -1;
                    populate(auu,buu,cuu,duu);
                    $("#a4").html(auu + " &nbsp; " + buu + " &nbsp; " + cuu + " &nbsp; " + duu);
                break;

                case "CB#$42":
                    $("#users").html(event.data.substring(6));    // Refresh browser with server state.
                break;

                case "CC#$42":
                    // Prevents new player login data from defaulting to a chat message.
                break;

                case "CD#$42":       // Prevent new player login data from displaying as a chat message.
                    if (sender !== player) {
                        $("#" + gameArray[3]).hide();
                        $("#" + gameArray[5]).val(gameArray[4]);
                        $("#" + gameArray[5]).html(gameArray[4]);
                    }
                break;

                case "CE#$42":
                    $("#a4").append(extra);  // Display computations.
                    $("#rollA").hide();
                    $("#newDisplay").show();
                    DS_ob.ar = [];
                break;

                case "CF#$42":
                    game = "on";
                    DS_ob.game = "on";
                    $("#a2").append("<br>" + sender + " clicked 'SCORE'");
                    DS_ob.ar = [];
                    $("#rollA").hide();
                    $("#newDisplay").show();
                    $("#scoreF").hide();
                    $('#go30').triggerHandler('click');
                    if (plX !== scX) {
                        $("#a0").append(sender + " clicked SCORE and must make the " +
                            "number '20' before time runs out.</h3>");
                        $("#newDisplay").hide();
                        $("#impossibleJ").hide();
                        $(".dropx").show();
                        $(".drop2x").show();
                        $(".drop").hide();
                        $(".drop2").hide();
                    }
                break;

                case "CG#$42":
                    $("#stop30").triggerHandler('click');
                    $("#a0").html("");
                    $("#a2").append("<br>One point for " + sender);
                    $("#a1").prepend("<span style='font-size:75px; background:#000; color:#f00;'>Score!</span>");
                    $("#newDisplay").show();
                    $("#countdown").html("");
                break;

                case "CH#$42":
                    if (plX !== sender && DS_ob.game === "on") {
                        assign (extra, ext4, ext5, ext6, ext7, ext8);
                        console.log("From CH#$42 " + extra, ext4, ext5, ext6, ext7, ext8)
                    }

                break;

                case "CK#$42":       // Prevent new player login data from displaying as a chat message.
                    if (sender !== player) {
{'fraction_non_alphanumeric': 0.1942215088282504, 'fraction_numerical': 0.018747993579454253, 'mean_word_length': 1.4498269896193772, 'pattern_counts': {'":': 32, '<': 17, '<?xml version=': 0, '>': 17, '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': '6565152', 'n_tokens_mistral': 4702, 'n_tokens_neox': 4550, 'n_words': 946}