<commit_before>(function(){
    /**
     * New node file
     */
    var colors = {};
    var thisPlayer = {};
    var playerList = [];
    var _socket = {};
    function abc(socket) {
        console.log(socket);
        _socket=socket;
        speed = 1;
        
        /**
         * test point
         *
        
         * selfX=2; 
         * selfY=3; 
         * selfId="ABC"; 
         * color="#980000";
         */

        var table = $('<table></table>').attr("id", "table_map").attr('class','battleTable');
        for (i = 1; i <= 12; i++) {
            var row = $('<tr></tr>').height('30');
            for (j = 1; j <= 30; j++) {
                var column = $('<td></td>').width('30');
                row.append(column);
            }
            table.append(row);
        }
        $('#base_table').append(table);
        $(window).unbind('keydown').keydown(doKeyDown);

    }

    function createTriangle(id, x, y, color) {
        var td = $("#table_map").find("tr").eq(y).find("td").eq(x);
        td.append($("<div></div>").addClass("moveU").attr("id", id).css("border-bottom", "15px solid " + color));
    }

    function doKeyDown(evt) {
        switch (evt.keyCode) {
        case 38: /* Up arrow was pressed */
            $('#test_movie_up').click();
            return;
        case 40: /* Down arrow was pressed */
            $('#test_movie_down').click();
            return;
        case 39: /* Right arrow was pressed */
            $('#test_movie_right').click();
            return;
        case 37: /* Left arrow was pressed */
            $('#test_movie_left').click();
            return;
        }
    }

    function updateMove(name, x, y, direction, isplay) {
        if(isplay&&!checkCollide(name, x, y, direction, isplay)){
            return;
        }
        $("#table_map").find("tr").eq(y).find("td").eq(x).append($("#" + name));
        var obj = $("#" + name);
        obj.removeClass().css({
            borderTop : "",
            borderBottom : "",
            borderLeft : "",
            borderRight : ""
        });
        switch (direction) {
        case "up":
            obj.addClass("moveU").css("border-bottom", "15px solid " + colors[name]);
            break;
        case "down":
            obj.addClass("moveD").css("border-top", "15px solid " + colors[name]);
            break;
        case "left":
            obj.addClass("moveL").css("border-right", "15px solid " + colors[name]);
            break;
        case "right":
            obj.addClass("moveR").css("border-left", "15px solid " + colors[name]);
            break;
        }
    }

    function checkCollide(name, x, y, direct, isplay) {
        var result=true;
        playerList.forEach(function(obj){
            if(obj.isPlay&&name != obj.name){
                if(obj.pos.x==x&&obj.pos.y==y){
                    var kill=false;
                    switch(direct){
                    case 'up': 
                        kill = obj.direct!='down';
                        break;
                    case 'down':
                        kill = obj.direct!='up';
                        break;
                    case 'right':
                        kill = obj.direct!='left';
                        break;
                    case 'left':
                        kill = obj.direct!='right';
                        break;
                    }
                    if(kill){
                        result=false;
                        killPlayer(obj);
                    }
                }
            }
        });
        return result;
    }
    
    function killPlayer(obj){
        console.log(obj.name+" died");<commit_msg>collide instead of die log<commit_after>(function(){
    /**
     * New node file
     */
    var colors = {};
    var thisPlayer = {};
    var playerList = [];
    var _socket = {};
    function abc(socket) {
        console.log(socket);
        _socket=socket;
        speed = 1;
        
        /**
         * test point
         *
        
         * selfX=2; 
         * selfY=3; 
         * selfId="ABC"; 
         * color="#980000";
         */

        var table = $('<table></table>').attr("id", "table_map").attr('class','battleTable');
        for (i = 1; i <= 12; i++) {
            var row = $('<tr></tr>').height('30');
            for (j = 1; j <= 30; j++) {
                var column = $('<td></td>').width('30');
                row.append(column);
            }
            table.append(row);
        }
        $('#base_table').append(table);
        $(window).unbind('keydown').keydown(doKeyDown);

    }

    function createTriangle(id, x, y, color) {
        var td = $("#table_map").find("tr").eq(y).find("td").eq(x);
        td.append($("<div></div>").addClass("moveU").attr("id", id).css("border-bottom", "15px solid " + color));
    }

    function doKeyDown(evt) {
        switch (evt.keyCode) {
        case 38: /* Up arrow was pressed */
            $('#test_movie_up').click();
            return;
        case 40: /* Down arrow was pressed */
            $('#test_movie_down').click();
            return;
        case 39: /* Right arrow was pressed */
            $('#test_movie_right').click();
            return;
        case 37: /* Left arrow was pressed */
            $('#test_movie_left').click();
            return;
        }
    }

    function updateMove(name, x, y, direction, isplay) {
        if(isplay&&!checkCollide(name, x, y, direction, isplay)){
            return;
        }
        $("#table_map").find("tr").eq(y).find("td").eq(x).append($("#" + name));
        var obj = $("#" + name);
        obj.removeClass().css({
            borderTop : "",
            borderBottom : "",
            borderLeft : "",
            borderRight : ""
        });
        switch (direction) {
        case "up":
            obj.addClass("moveU").css("border-bottom", "15px solid " + colors[name]);
            break;
        case "down":
            obj.addClass("moveD").css("border-top", "15px solid " + colors[name]);
            break;
        case "left":
            obj.addClass("moveL").css("border-right", "15px solid " + colors[name]);
            break;
        case "right":
            obj.addClass("moveR").css("border-left", "15px solid " + colors[name]);
            break;
        }
    }

    function checkCollide(name, x, y, direct, isplay) {
        var result=true;
        playerList.forEach(function(obj){
            if(obj.isPlay&&name != obj.name){
                if(obj.pos.x==x&&obj.pos.y==y){
                    var kill=false;
                    switch(direct){
                    case 'up': 
                        kill = obj.direct!='down';
                        break;
                    case 'down':
                        kill = obj.direct!='up';
                        break;
                    case 'right':
                        kill = obj.direct!='left';
                        break;
                    case 'left':
                        kill = obj.direct!='right';
                        break;
                    }
                    if(kill){
                        result=false;
                        killPlayer(obj);
                    }
                }
            }
        });
        return result;
    }
    
    function killPlayer(obj){
        console.log(obj.name+" collide");
{'fraction_non_alphanumeric': 0.16567245119305857, 'fraction_numerical': 0.010032537960954447, 'mean_word_length': 1.295985060690943, 'pattern_counts': {'":': 8, '<': 23, '<?xml version=': 0, '>': 19, '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': '5178162', 'n_tokens_mistral': 2123, 'n_tokens_neox': 2014, 'n_words': 393}