Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<ctime>
- using namespace std;
- int main()
- {
- srand(time(0));
- char mass[30][40];
- int a;
- int b;
- int chislo;
- cout << "Hardcore-1 , Easy-2";
- cin >> a;
- if (a == 1){
- b = 100;
- }
- else{b = 40;}
- for(int i = 0 ; i < 30 ; i++){
- for ( int j = 0; j < 40 ; j++){
- mass[i][j] = '0';
- }
- }
- for ( int i = 0; i < b ; i++){
- int o = rand()%30;//здесь я просто создаю рандомные числа без этог тоже можно но по мне так удобней
- int a = rand()%40;
- mass[o][a] = '!';
- if (mass[o][a+1] != '!' && a + 1 < 40){mass[o][a+1]++;}
- if (mass[o][a-1] != '!' && a - 1 >= 0){mass[o][a-1]++;}
- if (mass[o+2][a] != '!' && o + 2 < 30){mass[o+1][a]++;}
- if (mass[o-2][a] != '!' && o - 2 >= 0){mass[o-1][a]++;}
- }
- for(int i = 0 ; i < 30 ; i++){
- for ( int j = 0; j < 40 ; j++){
- cout << mass[i][j] << " ";
- }
- cout << endl;
- }
- lol:
- cout << "Now chose the plase on the field.";
- int m , n;
- cin >> m >> n;
- if (mass[m][n] == '!'){
- cout << "YOU LOOOOOOOOSER !!! YOU ARE THE WORST SAPPER!!!";// тут реакция на нажатие кнопеи
- //потом это надо заменить на цвета
- return 0;
- }
- else if (mass[m][n] == '1'){
- cout << "ONE IT IS NEARLY!";
- goto lol;
- }
- else if (mass[m][n] == '2'){
- cout << "TWO !!!";
- goto lol;
- }
- else if (mass[m][n] == '3'){
- cout << "THREE!!!";
- goto lol;
- }
- else if (mass[m][n] == '4'){
- cout << "FOUR!!!";
- goto lol;
- }
- else {cout << "ZERO!!!";
- goto lol;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement