<commit_before>#include <ncurses.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <time.h>
#include <termios.h>

#include "defines.h"

#include "clock.h"
#include "keyboard.h"
#include "screen.h"
#include "sound.h"

#include "state_title.h"

int gamestate;

void set_state(int state) {
    switch (gamestate) {
        case STATE_TITLE: title_destroy(); break;
        default: break;
    }

    clear();

    switch (state) {
        case STATE_TITLE: title_init(); break;
        default: break;
    }

    gamestate = state;
}

void init() {
    gamestate = -1;

    init_screen();
    sound_init();
    init_keyboard();

    set_state(STATE_TITLE);

    clock_start();
}

/**
 * Destroy the display and make things go back to normal.
 */
void destroy() {
    destroy_keyboard();
    destroy_screen();
}

void update() {
    float dt = clock_update();
<commit_msg>Switch up some logic to prevent potential errors Signed-off-by: <NAME> <<EMAIL>><commit_after>#include <ncurses.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <time.h>
#include <termios.h>

#include "defines.h"

#include "clock.h"
#include "keyboard.h"
#include "screen.h"
#include "sound.h"

#include "state_title.h"

int gamestate;

void set_state(int state) {
    switch (gamestate) {
        case STATE_TITLE: title_destroy(); break;
        default: break;
    }

    clear();

    gamestate = state;

    switch (gamestate) {
        case STATE_TITLE: title_init(); break;
        default: break;
    }
}

void init() {
    gamestate = -1;

    init_screen();
    sound_init();
    init_keyboard();

    set_state(STATE_TITLE);

    clock_start();
}

/**
 * Destroy the display and make things go back to normal.
 */
void destroy() {
    destroy_keyboard();
    destroy_screen();
}

void update() {
    float dt = clock_update();

{'fraction_non_alphanumeric': 0.14713474445018068, 'fraction_numerical': 0.0010325245224574084, 'mean_word_length': 3.2039045553145336, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '6108104', 'n_tokens_mistral': 727, 'n_tokens_neox': 706, 'n_words': 170}