-
Notifications
You must be signed in to change notification settings - Fork 2
/
Minesweeper.cpp
70 lines (65 loc) · 1.08 KB
/
Minesweeper.cpp
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
#include<iostream>
#include<assert.h>
using namespace std;
void renderengine(int gridx, int gridy, int coordx, int coordy, int choice){
string array [gridx] [gridy];
string display;
if(choice == 0){
display = " ";
}
if(choice == 1){
display = "1";
}
if(choice == 2){
display = "2";
}
if(choice == 3){
display = "3";
}
if(choice == 4){
display = "4";
}
if(choice == 5){
display = "5";
}
if(choice == 6){
display = "6";
}
if(choice == 7){
display = "7";
}
if(choice == 8){
display = "8";
}
if(choice == 9){
display = "-";
}
if(choice == 10){
display = "!";
}
if(choice == 11){
display = "?";
}
if(choice == 12){
display = "X";
}
if(choice >= 13){
cout<<"\n\nError: choice = "<<choice<<"\n\n";
assert(0);
}
array [coordx] [coordy] = display;
int county = 0;
cout<<"\n\n";
while(county < gridy){
int countx = 0;
while(countx < gridx){
cout<<array [countx] [county];
countx++;
}
county++;
}
cout<<"\n\n";
}
int main(){
renderengine(5, 5, 2, 2, 3);
}