-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPROJETINHO Anagrama.cpp
More file actions
165 lines (108 loc) · 4.33 KB
/
PROJETINHO Anagrama.cpp
File metadata and controls
165 lines (108 loc) · 4.33 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
Artur Henrique Pagno - 21013037
Carlos Eduardo Fontes Camacho - 21008649
Cesar Augusto Camote Inocencio - 20018446
Patrick Pimentel Correa Leite - 21007850
Felipe de Moura Tayar - 21019634
Joao Victor Moreira Vidal - 19291384
*/
#include <iostream>
#include <locale.h>
#include <string>
#include <string.h>
using namespace std;
void instrucoes()
{
cout << R"( _____ ___________ ___ ______ _____ _ _____ ___________ ___ _____ _
/ ___|| _ | ___ \/ _ \ | _ \ ___| | | | ___|_ _| ___ \/ _ \ / ___| |
\ `--. | | | | |_/ / /_\ \ | | | | |__ | | | |__ | | | |_/ / /_\ \\ `--.| |
`--. \| | | | __/| _ | | | | | __| | | | __| | | | /| _ | `--. \ |
/\__/ /\ \_/ / | | | | | | |/ /| |___ | |____| |___ | | | |\ \| | | |/\__/ /_|
\____/ \___/\_| \_| |_/ |___/ \____/ \_____/\____/ \_/ \_| \_\_| |_/\____/(_))";
cout << "\n\n\n================================================" << endl;
cout << "==================== REGRAS ====================" << endl;
cout << "================================================" << endl;
cout << "\n 1) Crie palavras com as letras do quadro" << endl;
cout << " 2) Total de 30 palavras com menos de 16 letras" << endl;
cout << " 3) Apos 5 erros o jogo e encerrado" << endl;
}
void Quadro()
{
int i = 0;
cout << "\n\n================================================" << endl;
cout << "============== QUADRO DE LETRAS ================" << endl;
cout << "================================================" << endl;
cout << "\n A G U A M R\n G O T C C J\n O L E I E S\n S U Q N A U\n";
}
void Banco()
{
cout << "\n\n================================================" << endl;
cout << "============== BANCO DE PALAVRAS ===============" << endl;
cout << "================================================" << endl;
cout << "AGUA AMARGO ARCO ARO ATA CARO\n";
cout << "CIRCO COR JOGO LEITE LETRA LEVA\n";
cout << "LUA MACA MALA MESA META MIRA\n";
cout << "MISSA OVO RUA QUEIJO QUIMONO SINETA\n";
cout << "SINO SOLETRA SONECA SUINO SUMO TACO\n";
}
int main()
{
char alternativa[20];
int i, j;
int corretas = 0;
int achou = 0;
char selecao;
int erros = 0;
int teveErro = 0;
instrucoes();
char carec[22] = { 'A', 'G', 'U', 'A', 'M', 'R',
'G', 'O', 'T', 'C', 'C', 'J', 'O', 'L', 'E', 'I', 'E',
'S', 'S', 'U', 'Q', 'N', };
char letras[30][23] = { "AGUA", "AMARGO", "ARCO", "ARO",
"ATA", "CARO", "CIRCO", "COR", "JOGO", "LEITE", "LETRA",
"LEVA", "LUA", "MACA", "MALA", "MESA", "META", "MIRA", "MISSA", "OVO", "RUA",
"QUEIJO", "QUIMONO", "SINETA", "SINO", "SOLETRA", "SONECA", "SUINO", "SUMO",
"TACO" };
char acertos[30][23];
do {
Quadro();
for (i = 0; i < corretas; i++) {
cout << "\nPalavras Corretas: " << acertos[i];
}
cout << " \n \nDigite uma palavra: ";
cin >> alternativa;
_strupr_s(alternativa);
fflush(stdin);
for (i = 0; i < 30; i++) {
if (strcmp(letras[i], alternativa) == 0) {
teveErro = 1;
for (j = 0; j < 30; j++) {
if (strcmp(acertos[j], alternativa) == 0) {
achou = 1; break;
}
}
if (achou == 0) {
corretas++;
acertos[corretas - 1];
strcpy_s(acertos[corretas - 1], alternativa);
}
}
}
if (teveErro == 0) {
erros++;
}
teveErro = 0;
if (erros >= 5) {
cout << "Você Teve Mais de 5 Erros!!!" << endl; break;
}
if (strcmp(alternativa, "ENTER") == 0)break;
} while (corretas < 30);
if (corretas == 30) {
cout << "\n Parabens :D Voce Acertou as 30 Palavras.";
}
cout << "\n\nDeseja visualizar o Banco de Palavras? (s/n)";
cin >> selecao;
if (selecao == 's' || selecao == 'S') {
Banco();
}
}