-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6495ed
commit e07df5a
Showing
2 changed files
with
58 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
______ ______ ______ ______ __ __ ______ ______ | ||
/\ ___\ /\ ___\ /\ __ \ /\ == \ /\ "-.\ \ /\ ___\ /\ == \ | ||
\ \ \____ \ \ \____\ \ \/\ \\ \ __< \ \ \-. \\ \ __\ \ \ __< | ||
\ \_____\ \ \_____\\ \_____\\ \_\ \_\\ \_\\"\_\\ \_____\\ \_\ \_\ | ||
\/_____/ \/_____/ \/_____/ \/_/ /_/ \/_/ \/_/ \/_____/ \/_/ /_/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,55 @@ | ||
#include<stdio.h> | ||
#include "linked-list/linked_list.h" | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#define MAX_LEN 1024 | ||
|
||
void print_image(FILE *fptr); | ||
void change_foreground_blue(); | ||
void change_foreground_red(); | ||
void change_foreground_yellow(); | ||
void change_foreground_green(); | ||
void reset(); | ||
|
||
int main(){ | ||
struct Node* head = NULL; | ||
// insert data in the linked list | ||
insert_data(&head, 1); | ||
insert_data(&head, 2); | ||
insert_data(&head, 3); | ||
insert_data(&head, 4); | ||
insert_data(&head, 5); | ||
insert_data(&head, 6); | ||
insert_data(&head, 7); | ||
// print linked list | ||
print_list(head); | ||
char *filename = "logo.txt"; | ||
FILE *fptr = NULL; | ||
change_foreground_green(); | ||
printf("=====================================================================\n"); | ||
if((fptr = fopen(filename,"r")) == NULL) | ||
{ | ||
fprintf(stderr,"error opening %s\n",filename); | ||
return 1; | ||
} | ||
print_image(fptr); | ||
fclose(fptr); | ||
printf("=====================================================================\n"); | ||
return 0; | ||
} | ||
|
||
void change_foreground_blue(){ | ||
printf("\033[0;34m"); | ||
} | ||
|
||
void change_foreground_yellow(){ | ||
printf("\033[0;33m"); | ||
} | ||
|
||
void change_foreground_red(){ | ||
printf("\033[0;31m"); | ||
} | ||
|
||
void change_foreground_green(){ | ||
printf("\033[0;32m"); | ||
} | ||
|
||
void reset(){ | ||
printf("\033[0m"); | ||
} | ||
|
||
void print_image(FILE *fptr) { | ||
char read_string[MAX_LEN]; | ||
while(fgets(read_string, sizeof(read_string), fptr) != NULL) { | ||
printf("%s", read_string); | ||
} | ||
printf("\n"); | ||
} |