-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsis.h
98 lines (90 loc) · 2.54 KB
/
sis.h
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
91
92
93
94
95
96
97
98
#ifndef sis
#define sis
#include "sis.h"
#include "unistd.h"
#include "stdio.h"
#include "stdlib.h"
#include "ctype.h"
#include "locale.h"
#include "time.h"
/*
* veja mais em
* https://github.com/rafatrinity
*/
void linha();
char SISTEMA;
char apresenta(){
printf("\n\n");
printf("\t\t\t.::::. :: .::::. ||\n");
printf("\t\t\t:: :: :: :: :: ||\n");
printf("\t\t\t:: :: :: :::::: ||\n");
printf("\t\t\t*::::* :::::: :: :: ::\n\n");
printf("\n\n");
sleep(1);
printf("\tPOR GENTILEZA, INFORME QUAL SISTEMA OPERACIONAL VC UTILIZA:\n\n\tD=DOS\n\tU=UNIX\n\n");
printf("\t\tDUVIDAS? DIGITE (i) PARA MAIS INFORMAÇÕES\n");
printf("\t");
linha();
pergunta:
fflush(stdin);
scanf("%c",&SISTEMA);
SISTEMA=toupper(SISTEMA);
switch(SISTEMA){
case 'D':
system("cls");
fflush(stdin);
break;
case 'U':
system("clear");
fflush(stdin);
break;
case 'I':
printf("\nDOS = Window\nUNIX = Mac e Linux(há exeções)");
getchar();
goto pergunta;
break;
default:
printf("\nENTRADA INVALIDA, FAVOR DIGITAR SOMENTE AS LETRAS INDICADAS\n");
goto pergunta;
}
return SISTEMA;
}
//============================escreve uma linha na tela=========================
void linha(){
usleep(100000);
for (int i = 0; i < 60; ++i)
printf("=");
usleep(100000);
printf("\n");
}
//==================================cabeçalho=================================
void cab(){
if (SISTEMA == 'D')
system("cls");
else
system("clear");
time_t t = time(NULL);
struct tm tm = *localtime(&t);
printf("============================================================\n");
printf("\tUNICARIOCA - ADIVINHA - ");
printf("%d/%d/%d - %d:%d\n",tm.tm_mday,tm.tm_mon+1,tm.tm_year + 1900,tm.tm_hour,tm.tm_min);
printf("============================================================\n\n");
}
void fim(){
if (SISTEMA == 'D')
system("cls");
else
system("clear");
printf("\t:: :: .::::::. :: :::::::::: :::::::\n");
printf("\t :: :: :: :: :: :: ::\n");
printf("\t :: :: :: :: :: :: ::::::: \n");
printf("\t :: :: :: :: :: :: ::\n");
printf("\t :: *::::::* ::::::: :: :::::::\n\n");
usleep(500000);
printf(" .:::::: ::::::: ::: ::: ::::::. ::::::. :::::::\n");
printf(" :: :: :::: :::: :: :: :: :: ::\n");
printf(" *:::::. ::::::: :: :: :: :: ::::::* ::::::* :::::::\n");
printf(" :: :: :: :::: :: :: :: :: ::\n");
printf(" ::::::* ::::::: :: :: :: :: :: :: :::::::\n");
}
#endif