This repository has been archived by the owner on Oct 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphics.c
90 lines (88 loc) · 1.72 KB
/
graphics.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include <stdio.h>
#include <stdlib.h>
#include "graphics.h"
#include "functions.h"
// Global Variables
int i;
void clear_screen(int pauseBool, int numOfnewlines)
{
fflush(stdin);
if(pauseBool)
getchar();
system("cls");
newline(numOfnewlines);
}
void sP(int a){
//sP short for spacePrint
//Input defines number of spaces printed
for(i=0;i<a;i++)
printf(" ");
}
void pInput(){
printf("\n\tInput: ");
}
void sectioner(int sectionType)
{
/* Input defines type of section:
0 for Menu Header section
1 for generic Section Header
2 for generic Section Footnote
3 for Input Section Header
4 for ERROR Section Header*/
switch(sectionType)
{
case 0:
clear_screen(0, 3);
linePrint(0,5);
printf(" MENU ");
linePrint(0,4);
break;
case 1:
clear_screen(0, 3);
linePrint(0,0);
printf(" Section START ");
linePrint(0,0);
break;
case 2:
newline(1);
linePrint(0,1);
printf(" Section END ");
linePrint(0,1);
break;
case 3:
newline(1);
linePrint(0,0);
printf(" INPUT SECTION ");
linePrint(0,0);
break;
case 4:
clear_screen(0, 3);
linePrint(0,4);
printf(" ERROR ");
linePrint(0,4);
break;
default:
errorHandler(0.1);
break;
}
newline(2);
}
void linePrint(int a, int b)
{
//Input a defines number of dash
//Input b defines additional dash to be added to input a
//B should only be used when input a == 0
if(a==0)
a=37+b;
for(i = 0;i<a;i++)
printf("=");
}
void newline(int a){
for(i = 0;i<a;i++)
printf("\n");
}
void exiter(){
printf("Detected Exit Option from input.\nProgram Exitting now.");
clear_screen(0, 0);
exit(0); // Exit program
} // DONT FUCKING USE EXITER UNLESS ABSOULUTELY NECCESSARY AS THERE WILL BE MEMORY LEAKAGE