<commit_before>$(function() {
    $(window).load(function() {

        var CURRENTPOS = 0;
        var POSITIONS = [];

        function updateGame(pos) {
            drawPosition(POSITIONS[pos]);
            $('#turn > span').text(Math.floor(pos / 4));
        }

        // nav
        $('#nav').show();
        $('#prev').click(function(e) {
            if (CURRENTPOS > 0) {
                CURRENTPOS--;
                updateGame(CURRENTPOS);
            }
        });
        $('#next').click(function(e) {
            if (CURRENTPOS < POSITIONS.length - 1) {
                CURRENTPOS++;
                updateGame(CURRENTPOS);
            }
        });
        $('#board').mousewheel(function(event) {
            if (event.deltaY == -1) {
                $('#next').click();
            } else if (event.deltaY == 1) {
                $('#prev').click();
            }
            event.stopPropagation();
            return false;
        });

        // if replay is loaded in global object it means game is over
        // else let's receive events and play them
        if (replay) {
            POSITIONS = replay.games
            updateGame(CURRENTPOS);
        } else {
            var source = new EventSource("/events/" + gameId);
            source.addEventListener('message', function(e) {
                var game = JSON.parse(e.data);
                POSITIONS.push(game);

                updateGame(CURRENTPOS);
                CURRENTPOS++;

                console.log(CURRENTPOS);

            });<commit_msg>Remove debug<commit_after>$(function() {
    $(window).load(function() {

        var CURRENTPOS = 0;
        var POSITIONS = [];

        function updateGame(pos) {
            drawPosition(POSITIONS[pos]);
            $('#turn > span').text(Math.floor(pos / 4));
        }

        // nav
        $('#nav').show();
        $('#prev').click(function(e) {
            if (CURRENTPOS > 0) {
                CURRENTPOS--;
                updateGame(CURRENTPOS);
            }
        });
        $('#next').click(function(e) {
            if (CURRENTPOS < POSITIONS.length - 1) {
                CURRENTPOS++;
                updateGame(CURRENTPOS);
            }
        });
        $('#board').mousewheel(function(event) {
            if (event.deltaY == -1) {
                $('#next').click();
            } else if (event.deltaY == 1) {
                $('#prev').click();
            }
            event.stopPropagation();
            return false;
        });

        // if replay is loaded in global object it means game is over
        // else let's receive events and play them
        if (replay) {
            POSITIONS = replay.games
            updateGame(CURRENTPOS);
        } else {
            var source = new EventSource("/events/" + gameId);
            source.addEventListener('message', function(e) {
                var game = JSON.parse(e.data);
                POSITIONS.push(game);

                updateGame(CURRENTPOS);
                CURRENTPOS++;
            });
{'fraction_non_alphanumeric': 0.14304548450889915, 'fraction_numerical': 0.003955174686882004, 'mean_word_length': 1.3382126348228043, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1599184', 'n_tokens_mistral': 832, 'n_tokens_neox': 774, 'n_words': 160}