<commit_before>#include <iostream>
#include <iomanip>   // format manipulation

using namespace std;
/**This program displays an equilateral triangle based on the user's input.
 * The user decides on its size and the character that it may consist of.
 * The triangle increases by three characters each time and is based on the 
 * T(n)=2n+1 equation.*/
void inputCheck(int & size)//Still trying to figure our cin.fail() and cin.good()
{
 bool isdigit();
    if(size.isdigit()==true)
        
        cin.good();
    cout<<endl;
        
    else
        cin.fail();
        cout << "Please re-enter a size. ";
        cin.clear();
        cin>>size;
}
void generateEquilateralTriangle(char character, int size)
{
     for (int i = 0; i < size; i++)
    {
        
        for (int j = 0; j < (2*size+1); j++)
        {
            
            if ((size+i) >= j && (size-i) <= j)
             
                cout << character;
            
            else
              
                cout << " ";
            
        } 
        cout << endl;
    }
}
/**The user inputs their request in the main function.*/
int main()
{
int size;
char character;

    cout << "Enter a size for your triangle: " << endl;
    cin  >> size;
    cout << "Enter a character for your triangle: " << endl;
    cin  >> character;
    
    inputCheck();
    generateEquilateralTriangle(character, size);
      
    return 0;
}<commit_msg>Second attempt at changes to triangle memes<commit_after>#include <iostream>

 using namespace std;

/** 
* The purpose of this function is to displays an equilateral
* triangle based on the user's input.
* The user decides on its size and the character that it may consist of.
* The triangle increases by three characters each time and is based on the
* T(n)=2n+1 equation.
* @param char character The character that the user enters.
* @param int size The size of the triangle.
*/

void generateEquilateralTriangle(char character, int size)
{

     for (int i = 0; i < size; i++){

        for (int j = 0; j < (2*size+1); j++){

            cout << (((size+i) >= j && (size-i) <= j)?character: ' ');

        }

        cout << endl;

     }
}

/**
* The purpose of this function is to validate the user's input.
* @param char character The character that the user enters.
* @param int size The size of the triangle.
* @return True if input is invalid.
*/

bool validateInput(char character,int size)
{
    if (cin.fail()){

        cin.clear();
        cin.ignore();
    }
    else
        generateEquilateralTriangle(character,size);

}

/**
 * The purpose of this method is to manage user input in order to
 * correctly display the triangle.
 *
 * @author <NAME>
 * @return The valid input and display the triangle.
 */

int main()
{
int size;
char character;

    do{

        cout << "Enter a size for your triangle: " << endl;
        cin  >> size;
        cout << "Enter a character for your triangle: " << endl;
        cin  >> character;

    }while(validateInput(character,size)!=0);

    return 0;

 }
{'fraction_non_alphanumeric': 0.11675461741424802, 'fraction_numerical': 0.004947229551451188, 'mean_word_length': 2.2683189655172415, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 19, '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': '2778878', 'n_tokens_mistral': 905, 'n_tokens_neox': 867, 'n_words': 343}