diff --git a/src/main.c b/src/main.c index dcca5f4..2b4b4d5 100644 --- a/src/main.c +++ b/src/main.c @@ -17,16 +17,68 @@ Datum: 04.12.2024 0.1 04.12.2024 Dokument erstellt */ -int terminal_size (int argc, char **argv) -{ - struct winsize w; - ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); - - printf ("lines %d\n", w.ws_row); - printf ("columns %d\n", w.ws_col); - return 0; // make sure your main returns int +void print_wellcome_line(char line[100], int spaces){ + for(int i = 0; i < spaces; i++){ + printf(" "); + } + printf("%s\n", line); } +void print_wellcome(int terminal_with, int terminal_higt){ + printf("\e[1;1H\e[2J"); + + for(int i = 0; i < (terminal_higt - 10) / 2; i++){ + printf("\n"); + } + + int spaces = (terminal_with - 83) / 2; + print_wellcome_line("__ ___ _ _ _ ", spaces); + print_wellcome_line("\\ \\ / (_) | | | _____ _ __ ___ _ __ ___ ___ _ __ _____ _ _ __ ___ ", spaces); + print_wellcome_line(" \\ \\ /\\ / /| | | | |/ / _ \\| '_ ` _ \\| '_ ` _ \\ / _ \\ '_ \\ |_ / | | | '_ ` _ \\", spaces); + print_wellcome_line(" \\ V V / | | | | < (_) | | | | | | | | | | | __/ | | | / /| |_| | | | | | | ", spaces); + print_wellcome_line(" \\_/\\_/ |_|_|_|_|\\_\\___/|_| |_| |_|_| |_| |_|\\___|_| |_| /___|\\__,_|_| |_| |_| ", spaces); + print_wellcome_line(" ", spaces); + print_wellcome_line(" ____ _ _ _ _ _ _ _ __ ", spaces); + print_wellcome_line("| _ \\| |__ ___ | |_| |__ ___ _ __ (_) ___ ___ | | | | ___| |/ _| ___ _ __ ", spaces); + print_wellcome_line("| |_) | '_ \\ / _ \\| __| '_ \\ / _ \\| '_ \\| |/ __/ __| | |_| |/ _ \\ | |_ / _ \\ '__| ", spaces); + print_wellcome_line("| __/| | | | (_) | |_| | | | (_) | | | | | (__\\__ \\ | _ | __/ | _| __/ | ", spaces); + print_wellcome_line("|_| |_| |_|\\___/ \\__|_| |_|\\___/|_| |_|_|\\___|___/ |_| |_|\\___|_|_| \\___|_| ", spaces); + + sleep(3); + + /* + printf("__ ___ _ _ _ "); + printf("\ \ / (_) | | | _____ _ __ ___ _ __ ___ ___ _ __ _____ _ _ __ ___ "); + printf(" \ \ /\ / /| | | | |/ / _ \| '_ ` _ \| '_ ` _ \ / _ \ '_ \ |_ / | | | '_ ` _ \ "); + printf(" \ V V / | | | | < (_) | | | | | | | | | | | __/ | | | / /| |_| | | | | | |"); + printf(" \_/\_/ |_|_|_|_|\_\___/|_| |_| |_|_| |_| |_|\___|_| |_| /___|\__,_|_| |_| |_|"); + printf(" "); + printf(" ____ _ _ _ _ _ _ _ __ "); + printf("| _ \| |__ ___ | |_| |__ ___ _ __ (_) ___ ___ | | | | ___| |/ _| ___ _ __ "); + printf("| |_) | '_ \ / _ \| __| '_ \ / _ \| '_ \| |/ __/ __| | |_| |/ _ \ | |_ / _ \ '__|"); + printf("| __/| | | | (_) | |_| | | | (_) | | | | | (__\__ \ | _ | __/ | _| __/ | "); + printf("|_| |_| |_|\___/ \__|_| |_|\___/|_| |_|_|\___|___/ |_| |_|\___|_|_| \___|_| "); + + printf("__ ___ _ _ _ \n"); + printf("\\ \\ / (_) | | | _____ _ __ ___ _ __ ___ ___ _ __ _____ _ _ __ ___ \n"); + printf(" \\ \\ /\\ / /| | | | |/ / _ \\| '_ ` _ \\| '_ ` _ \\ / _ \\ '_ \\ |_ / | | | '_ ` _ \\ \n"); + printf(" \\ V V / | | | | < (_) | | | | | | | | | | | __/ | | | / /| |_| | | | | | | \n"); + printf(" \\_/\\_/ |_|_|_|_|\\_\\___/|_| |_| |_|_| |_| |_|\\___|_| |_| /___|\\__,_|_| |_| |_| \n"); + printf(" \n"); + printf(" ____ _ _ _ _ _ _ _ __ \n"); + printf("| _ \\| |__ ___ | |_| |__ ___ _ __ (_) ___ ___ | | | | ___| |/ _| ___ _ __ \n"); + printf("| |_) | '_ \\ / _ \\| __| '_ \\ / _ \\| '_ \\| |/ __/ __| | |_| |/ _ \\ | |_ / _ \\ '__| \n"); + printf("| __/| | | | (_) | |_| | | | (_) | | | | | (__\\__ \\ | _ | __/ | _| __/ | \n"); + printf("|_| |_| |_|\\___/ \\__|_| |_|\\___/|_| |_|_|\\___|___/ |_| |_|\\___|_|_| \\___|_| \n"); + */ + + + + + + + +} int main(int argc, char **argv){ // int x = test_gruppe_programmname(); @@ -40,6 +92,7 @@ int main(int argc, char **argv){ printf ("columns %d\n", w.ws_col); + print_wellcome(w.ws_col, w.ws_row); return 0;