<commit_before>/*
<NAME>
Lab 1B
09/16/2014
Testing sides to make triangles.
*/

#include <math.h>
#include <stdio.h>

int main() {
    long sidesArr[3] = {0};
    char toContinue = NULL;
    long input = 0;
    int i = 0;

    while (input != 'N'){
        printf("Please enter the length of a side of a triangle: ");
        scanf("%ld", &input);
        if (input > 0) {
            sidesArr[i] = input;
            i++;
        }
        else printf("Your input is invalid. Please enter an unsigned integer as the length of your side.");

        if (i == 3) {
            /* output test results, reset 'i' and ask to terminate program */
            i = 0;
            printf("Would you like to test another triangle? Type \'N\' to exit test.\n");
            scanf("%c", &toContinue);
        }
    }

    return 0;
}<commit_msg>successful scanf implementation. starting sides check.<commit_after>/*
<NAME>
Lab 1B
09/16/2014
Testing sides to make equilateral, isosceles, or scalene triangles.
*/

#include <math.h>
#include <stdio.h>

int sidesCheck(double arr[], int size);

int main() {
    int i = 0;
    double input = 0.0;
    double triangleSidesArr[3] = {0.0, 0.0, 0.0};

    for (i = 0; i < 3;) {
        printf("Please enter a length.\n");

        int returnSuccessful = scanf("%lf", &input);
/*        printf("%.2d\n", returnSuccessful);    /**/

        if (returnSuccessful == 1) {
            if (input > 0) {
                triangleSidesArr[i] = input;
                i++;
            }
/*            printf("%lf - %lf\n", input, sidesArr[i]);    /**/
            else if (triangleSidesArr[i] <= 0.0) {
                printf("Invalid input. Please enter an unsigned length.\n");
            } else {
                printf("Something weird happened.");
                break;
            }
        }
        if (returnSuccessful < 1) {
            scanf("%*s");
            printf("Invalid input. Please enter a length.\n");
        }
    }

/*    printf("Sides array set to ");
    for (i = 0; i < 3; i++) {
        printf("[%lf]", triangleSidesArr[i]);
        if (i !=2) printf(", ");
        else printf(".\n");
    }    /**/

    if (sidesCheck(triangleSidesArr, 3)) printf("Success! The lengths entered can make a triangle.");
 
    return 0;
}

int sidesCheck(double arr[], int size) {
    int isPossible = 0;
    int i = 0;

    for (i = 0; i < size; i++) {
    }
    return isPossible;
}
{'fraction_non_alphanumeric': 0.15254237288135594, 'fraction_numerical': 0.02149648615130219, 'mean_word_length': 1.8271028037383177, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 11, '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': '4499847', 'n_tokens_mistral': 816, 'n_tokens_neox': 750, 'n_words': 241}