From 3f003c2f9b1ae3b0d4a2f0a4d51119cbec44ea8c Mon Sep 17 00:00:00 2001 From: fdai7472 Date: Mon, 5 Feb 2024 20:24:06 +0100 Subject: [PATCH] refactoring: bessere Willkommensnachricht --- src/main/c/Stefan/blackjack.c | 16 ++++++++++++++-- src/main/c/Stefan/blackjack.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/c/Stefan/blackjack.c b/src/main/c/Stefan/blackjack.c index 8fc8042..112c91b 100644 --- a/src/main/c/Stefan/blackjack.c +++ b/src/main/c/Stefan/blackjack.c @@ -6,8 +6,7 @@ int blackjack(){ - - printf("Welcome to Blackjack \n\n"); + welcomeMessageBJ(); bool exit = false; bool *exitPtr = &exit; @@ -227,4 +226,17 @@ int calculateWinnings(bool blackjack, int bet){ } printf("Du hast %d gewonnen!\n", bet); return 2 * bet; +} + +void welcomeMessageBJ(){ + + printf("Willkommen zu..\n\n" + " _ _ _ _ _ \n" + "| | | | | | (_) | | \n" + "| |__ | | __ _ ___| | ___ __ _ ___| | __\n" + "| '_ \\| |/ _` |/ __| |/ / |/ _` |/ __| |/ /\n" + "| |_) | | (_| | (__| <| | (_| | (__| < \n" + "|_.__/|_|\\__,_|\\___|_|\\_\\ |\\__,_|\\___|_|\\_\\\n" + " _/ | \n" + " |__/ \n\n"); } \ No newline at end of file diff --git a/src/main/c/Stefan/blackjack.h b/src/main/c/Stefan/blackjack.h index ca3e08b..3723164 100644 --- a/src/main/c/Stefan/blackjack.h +++ b/src/main/c/Stefan/blackjack.h @@ -4,6 +4,7 @@ #include int blackjack(); +void welcomeMessageBJ(); int getBalanceBJ(); int getBetBJ(int balance, bool *exitPtr); int userInputBJ();