<commit_before>//
//  main.cpp
//  mathgame1
//
//  Created by Nicholas on 25/07/2015.
//  Copyright (c) 2015 Nicholas. All rights reserved.
//

#include <iostream>
#include "StartUp.h"
#include "RandomNumber.h"
#include "QuestionGenerator.h"
#include "checker.h"

int main() {
    std::string UserName = StartUp();
    int count(0);
    for (int i = 0; i < 10; i++){
    struct QuestionAnswer QA1;
    QA1 = QuestionGenerator();
    std::cout << QA1.question << std::endl;
        if (Checker(QA1) == true){
            ++count;
        }
    }
    std::cout << UserName << " got " << count << " out of 10 right!" << std::endl;
    return 0;
}<commit_msg>made a change so that it now tests if the user wants to quit. Then flushes the stream<commit_after>//
//  main.cpp
//  mathgame1
//
//  Created by Nicholas on 25/07/2015.
//  Copyright (c) 2015 Nicholas. All rights reserved.
//

#include <iostream>
#include "StartUp.h"
#include "RandomNumber.h"
#include "QuestionGenerator.h"
#include "checker.h"

int main() {
    std::string UserName = StartUp();
    //count tracks how many quesitons user got right
    int count(0);
    //boolean for checking if user wants app to restart
    bool run = true;
    while (run)
    {
        //for loop generates ten quesitons
        for (int i = 0; i < 10; i++)
        {
            QuestionAnswer QA1;
            QA1 = QuestionGenerator();
            std::cout << QA1.question << std::endl;
            //if user got answer right add one to counter
            if (Checker(QA1)){
                ++count;
            }
        }
        std::cout << UserName << " got " << count << " out of 10 right!" << "\n";
        
        //checks if user wants to replay the game
        std::cout << "Run again? (Press Y for yes, N for no)"<<"\n";
        char runagain = 0;
        std::cin >> runagain;
        if (runagain == 'Y'||runagain == 'y')
        {
            run =true;
        }
        else {
            run = false;
        }
    }
    //close app and flush the stream
    std::cout << "Thankyou for playing" << std::endl;
    return 0;
}
{'fraction_non_alphanumeric': 0.1431980906921241, 'fraction_numerical': 0.023389021479713605, 'mean_word_length': 1.9942857142857142, 'pattern_counts': {'":': 0, '<': 43, '<?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': '5351518', 'n_tokens_mistral': 698, 'n_tokens_neox': 654, 'n_words': 218}