<commit_before>package com.covoex.qarvox.Application;

import com.covoex.qarvox.Logic.GameCharacter;
import com.covoex.qarvox.Logic.Person;

import java.util.ArrayList;
import java.util.Collections;

import static com.covoex.qarvox.Application.Input.s;
import static com.covoex.qarvox.Application.Input.worldInput;

/**
 * @author <NAME>
 */

public class BasicFunction {
    public static Person mainCharacter = new Person();

    public static void programStart() {
        System.out.println("----------------------------------------------------------------------------------");
        System.out.println("----------------------------------------------------------------------------------");
        System.out.println("Qarvox is a text-based java RPG Game created by <NAME>");
        System.out.println("----------------------------------------------------------------------------------");
        System.out.println("");
        System.out.print("Press [any key] and [Enter] to play the game" + ": ");

        if (String.valueOf(s.nextLine()).matches(".")) {
            System.out.println();
            System.out.print("Type in your character's name" + ": ");
            mainCharacter.setName(s.nextLine());
            System.out.println();
            System.out.print(
                    "Do you want to play the tutorial? Press [y] or [n] and [Enter]" + ": ");
            if (s.nextLine().equals("y")) {
                Tutorial.tutorial();
            } else if (s.nextLine().equals("n")) {
                System.out.print("What world do you want to go? World: ");
                worldInput(s.nextInt());
            }
        }
    }

    /**
     * @return randomstring
     */
    public static String getRandomString() {
        String baseString = "abcdjfghijklmnopqrstuvwxyz";
        String string = "";

        for (int i = 0; i < 5; i++) {
            int value = (int) (Math.random() * 100);
            while (value > 26) {
                value = (int) (Math.random() * 100);
                if (value <= 25) {
                    break;
                }
            }
            string += baseString.charAt(value);
        }
        return string;
    }

    public static void printHealthGauge(GameCharacter c) {
        String returnString = "";
        String addString = "";
        for (int i = 0; i < (c.getInitialHealth() - c.getHealth()); i++) {
            addString += " ";
        }
        for (int i = 0; i < c.getHealth(); i++) {
            returnString += '\u0254';
        }
        System.out.println("[" + returnString + addString + "]");
    }

    /**
     * get random int between [-1 - 1]
     */
    public static int randomInt() {
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(-1);
        arrayList.add(0);
        arrayList.add(1);
        Collections.shuffle(arrayList);<commit_msg>Optimized the code<commit_after>package com.covoex.qarvox.Application;

import com.covoex.qarvox.Logic.GameCharacter;
import com.covoex.qarvox.Logic.Person;

import java.util.ArrayList;
import java.util.Collections;

import static com.covoex.qarvox.Application.Input.s;
import static com.covoex.qarvox.Application.Input.worldInput;
import static com.covoex.qarvox.Application.Tutorial.tutorial;

/**
 * @author <NAME>
 */

public class BasicFunction {
    public static Person mainCharacter = new Person();

    public static void programStart() {
        System.out.println("--------------------------------------------------------------");
        System.out.println("Qarvox is a text-based java RPG Game created by <NAME>.");
        System.out.println("--------------------------------------------------------------");
        System.out.println();
        System.out.print("Press [any key] and [Enter] to play the game" + ": ");

        if (String.valueOf(s.nextLine()).matches(".")) {
            System.out.println();
            System.out.print("Type in your character's name" + ": ");
            mainCharacter.setName(s.nextLine());
            System.out.println();
            System.out.print(
                    "Do you want to play the tutorial? Press [y] or [n] and [Enter]" + ": ");

            if (yesOrNo()) {
                tutorial();
            } else {
                System.out.println();
                System.out.print("What world do you want to go? World: ");
                worldInput(s.nextInt());
            }
        }
    }

    /**
     * @return randomstring
     */
    public static String getRandomString() {
        String baseString = "abcdjfghijklmnopqrstuvwxyz";
        String string = "";

        for (int i = 0; i < 5; i++) {
            int value = (int) (Math.random() * 100);
            while (value > 26) {
                value = (int) (Math.random() * 100);
                if (value <= 25) {
                    break;
                }
            }
            string += baseString.charAt(value);
        }
        return string;
    }

    public static boolean yesOrNo() {
        String string = s.nextLine();
        if (string.contains("y")) {
            return true;
        } else if (string.contains("n")) {
            return false;
        } else {
            System.out.print("Press [y] or [n] and [Enter]: ");
            yesOrNo();
        }
        return false;
    }

    public static void printHealthGauge(GameCharacter c) {
        String returnString = "";
        String addString = "";
        for (int i = 0; i < (c.getInitialHealth() - c.getHealth()); i++) {
            addString += " ";
        }
        for (int i = 0; i < c.getHealth(); i++) {
            returnString += '\u0254';
        }
        System.out.println("[" + returnString + addString + "]");
    }

    /**
     * get random int between [-1 - 1]
     */
    public static int randomInt() {
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(-1);
        arrayList.add(0);
        arrayList.add(1);
        Collections.shuffle(arrayList);
{'fraction_non_alphanumeric': 0.19620569146280578, 'fraction_numerical': 0.007655183890830421, 'mean_word_length': 1.5509337860780985, 'pattern_counts': {'":': 6, '<': 19, '<?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': '1791185', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1637, 'n_words': 386}