<commit_before>/*  Prints the formatted calendar for a month
    based in the number of days and code of
    the starting day of the week of the month.

    Author: <NAME>
    Date:   Oct 25th, 2013
*/

#include <stdio.h>

// Function prototype
void printCalendar(int, int);

int main() {
    int numDays, dayOfWeek;

    printf("Type in the number of days in the month: ");
    scanf("%d", &numDays);
    printf("Type in the starting day of the week of the month: ");
    scanf("%d", &dayOfWeek);

    printCalendar(numDays, dayOfWeek);

    return 0;
}

/*  Function:  printCalendar
    Objective: Print a formatted calendar of a month based
               on the number os days and starting day of
               the week of it.
    Parametres:
     - numDays (value): Number of days of the month
     - dayOfWeek (value): Code for the day of the week
                          (0 = Sunday, 1 = Monday etc.)
    Return: None
*/
void printCalendar(int numDays, int dayOfWeek) {
    // Local variables for counters
    int i, j;

    // Prints the header of the calendar
    printf("Sun\tMon\tTue\tWed\tThu\tFri\tSat\n");

    // Skips the days of the week prior to day one's
    for (i = 0; i < dayOfWeek; i++)
        printf("\t");
    j = dayOfWeek;

    // Prints the days in the calendar
    // i: current day of the month
    // j: current day of the week
    for (i = 1; i <= numDays; i++) {
        printf("%d\t", i); // Prints the day
        j++;               // Increments the current day of the week
        if (j > 6) {
            printf("\n");  // Starts another line
            j = 0;         // Starts the count of the day of the week again
        }
    }
}<commit_msg>Prettier formating of the calendar<commit_after>/*  Prints the formatted calendar for a month
    based in the number of days and code of
    the starting day of the week of the month.

    Author: <NAME>
    Date:   Oct 25th, 2013
*/

#include <stdio.h>

// Function prototype
void printCalendar(int, int);

int main() {
    int numDays, dayOfWeek;

    printf("Type in the number of days in the month: ");
    scanf("%d", &numDays);
    printf("Type in the starting day of the week of the month: ");
    scanf("%d", &dayOfWeek);

    printCalendar(numDays, dayOfWeek);

    return 0;
}

/*  Function:  printCalendar
    Objective: Print a formatted calendar of a month based
               on the number os days and starting day of
               the week of it.
    Parametres:
     - numDays (value): Number of days of the month
     - dayOfWeek (value): Code for the day of the week
                          (0 = Sunday, 1 = Monday etc.)
    Return: None
*/
void printCalendar(int numDays, int dayOfWeek) {
    // Local variables for counters
    int i, j;

    // Prints the header of the calendar
    printf("\nSun Mon Tue Wed Thu Fri Sat\n");

    // Skips the days of the week prior to day one's
    for (i = 0; i < dayOfWeek; i++)
        printf("    ");
    j = dayOfWeek;

    // Prints the days in the calendar
    // i: current day of the month
    // j: current day of the week
    for (i = 1; i <= numDays; i++) {
        printf(" %2d ", i); // Prints the day
        j++;               // Increments the current day of the week
        if (j > 6) {
            printf("\n");  // Starts another line
            j = 0;         // Starts the count of the day of the week again
        }
    }
}
{'fraction_non_alphanumeric': 0.10264705882352941, 'fraction_numerical': 0.007941176470588234, 'mean_word_length': 1.9885764499121266, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '7271189', 'n_tokens_mistral': 1069, 'n_tokens_neox': 999, 'n_words': 441}