<commit_before>/*
 * Justin's Awesome Game Engine
 * or *
 * Just Another Game Engine
 *
 * Copyright 2016 <NAME>
 *
 * See included LICENSE file for distribution and reuse.
*/

#include <cstdio>

#include <Engine.hpp>

int main(const int argc, const char** argv) {
    std::cout << "Start" << std::endl;;
    Engine theGame(argc, argv);
    if (theGame.ready()) {
        if (theGame.run()) {
        } else {
            std::cerr << "Error running Engine, quitting." << std::endl;;
            return EXIT_FAILURE;
        }
    } else {
        std::cerr << "Could not initialize Engine, quitting." << std::endl;;
        return EXIT_FAILURE;
    }
    std::cout << "Done" << std::endl;;

    return EXIT_SUCCESS;
}
<commit_msg>Reorganize main() for clarity and modern C++-ness.<commit_after>/*
 * Justin's Awesome Game Engine
 * or *
 * Just Another Game Engine
 *
 * Copyright 2016 <NAME>
 *
 * See included LICENSE file for distribution and reuse.
*/

#include <Engine.hpp>

static std::unique_ptr<Engine> theGame;

int success(const std::string& msg);
int fail(const std::string& msg);

int main(const int argc, const char** argv) {
    std::cout << "Start" << std::endl;
    theGame = std::make_unique<Engine>(argc, argv);
    if (not theGame->ready()) {
        return fail("Could not initialize Engine, quitting.");
    }
    if (not theGame->run()) {
        return fail("Error running Engine, quitting.");
    }
    return success("Done");
}

int success(const std::string& msg) {
    theGame.release();
    std::cout << msg << std::endl;
    return EXIT_SUCCESS;
}

int fail(const std::string& msg) {
    theGame.release();
    std::cerr << msg << std::endl;
    return EXIT_FAILURE;
}

{'fraction_non_alphanumeric': 0.15294117647058825, 'fraction_numerical': 0.004705882352941176, 'mean_word_length': 3.0889423076923075, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 12, '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': '2428119', 'n_tokens_mistral': 543, 'n_tokens_neox': 531, 'n_words': 158}