-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwelcome_ui.c
48 lines (37 loc) · 1.45 KB
/
welcome_ui.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "welcome_ui.h"
#include <stdio.h>
#include <stdlib.h>
void clearScreen() { // a custom clear screen function for windows/(MAC , LINUX)
#ifdef _WIN32
system("cls");
#else
system("clear");
#endif
}
void printWelcomeMessage() { // made a ascii art for welcome message
clearScreen();
for(int i=0; i<7; i++)
printf("__ _ __ ");
printf("\n _ _ _ _ _ _ _ \n");
printf(" / \\ / \\ / \\ / \\ / \\ / \\ / \\ \n");
printf(" ( H ) ( A ) ( N ) ( G ) ( M ) ( A ) ( N )\n");
printf(" \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \\_/ \n");
printf(BLUE "\n !!! WELCOME TO THE HANGMAN GAME !!! \n\n" RESET);
printf(GREEN "BY : RISHU --- MOHIT --- AYUSH --- KARTIK\n" RESET);
for(int i=0; i<7; i++)
printf("__ _ __ ");
printf("\n\nPress ENTER key to continue .......");
getchar(); // we used getchar function to keep the game on hold until player enters
clearScreen();
}
void displayMainMenu() {
clearScreen();
printf(MAGENTA" +---------------------+\n");
printf(" | MAIN MENU |\n");
printf(" +---------------------+\n"RESET);
printf(" | 1. Start Game |\n");
printf(" | 2. View Leaderboard |\n");
printf(" | 3. Exit |\n");
printf(MAGENTA" +---------------------+\n"RESET);
printf("Enter your choice: ");
}