<commit_before>
var loop;
var level;
var viktoria;
var skin;

function parse(str) {
    restart();
    var i = 0;


     loop = setInterval(function () {
         Player.canPerformAction = true;


        i++;
        console.log("ROUND " + i + " ------------------");

        check();

        var element = Player.checkNextField(Map.map);

        switch (element.name) {
            case 'r':
                if(Player.health < 100){
                    Player.health += 20;
                }
                Player.canMove = true;
                var audio = new Audio('assets/sounds/coin.mp3');
                audio.play();
                Map.map.splice(Map.map.indexOf(element), 1);
                break;
            case 'e':
                Player.canMove = false;
                element.attack();
                break;
            case 'c':
                Player.canMove = false;

                break;
            case 's':
                Player.canMove = true;
                if(Player.health < 100){
                    Player.health += 20;
                }
                break;
            case 'g':
                viktoria = true;
                break;
            default:
                if(Player.health < 100){
                    Player.health += 20;
                }
                Player.canMove = true;
                break;
        }

        eval(str);

        Display.initMap(skin, Map.map);


        if(i>25){ clearInterval(loop);}

    }, 500);

}

function check() {
    if (viktoria){<commit_msg>Disable loops in user's code<commit_after>
var loop;
var level;
var viktoria;
var skin;

function parse(str) {
    restart();
    var i = 0;


     loop = setInterval(function () {
         Player.canPerformAction = true;


        i++;
        console.log("ROUND " + i + " ------------------");

        check();

        var element = Player.checkNextField(Map.map);

        switch (element.name) {
            case 'r':
                if(Player.health < 100){
                    Player.health += 20;
                }
                Player.canMove = true;
                var audio = new Audio('assets/sounds/coin.mp3');
                audio.play();
                Map.map.splice(Map.map.indexOf(element), 1);
                break;
            case 'e':
                Player.canMove = false;
                element.attack();
                break;
            case 'c':
                Player.canMove = false;

                break;
            case 's':
                Player.canMove = true;
                if(Player.health < 100){
                    Player.health += 20;
                }
                break;
            case 'g':
                viktoria = true;
                break;
            default:
                if(Player.health < 100){
                    Player.health += 20;
                }
                Player.canMove = true;
                break;
        }
        const regex = /(while|for)/g
        if (regex.exec(str)) {
            console.log('A kódban nem lehet ciklus!');
            clearInterval(loop);
        } else {
            eval(str);
        }

        Display.initMap(skin, Map.map);


        if(i>25){ clearInterval(loop);}

    }, 500);

}

function check() {
    if (viktoria){
{'fraction_non_alphanumeric': 0.12458219386204801, 'fraction_numerical': 0.013977514433302947, 'mean_word_length': 1.0358688930117501, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2044418', 'n_tokens_mistral': 972, 'n_tokens_neox': 855, 'n_words': 189}