Advertisement
Bertran_rz

Untitled

Sep 8th, 2021
1,190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <unistd.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int const size = 10;
  9.    
  10.     int arr[size][size];
  11.  
  12.     int oneCount = 0;
  13.  
  14.     for(int i = 0; i < size; i++)
  15.     {
  16.         for(int j = 0; j < size; j++)
  17.         {
  18.             arr[i][j] = 0;
  19.             cout << arr[i][j] << " ";
  20.         }
  21.         cout << endl;
  22.     }
  23.     cout << endl;
  24.    
  25.     //Paint first level board
  26.     //int boadSize = 1;
  27.     //int placeSize = 3;
  28.     int x = 0;
  29.     int y = 0;
  30.    
  31.     if(arr[x][y] != 1 || arr[x][y] != 2)
  32.     {
  33.         for(int i = y - 1; i < y + 2;  i++)
  34.         {
  35.             for(int j = x - 1; j < x + 2; j++)
  36.             {
  37.                 if(i >= 0 || j >= 0)
  38.                     arr[i][j] = 2;
  39.             }
  40.         }
  41.    
  42.         arr[x][y] = 1;
  43.     }
  44.  
  45.     for(int i = 0; i < size; i++)
  46.     {
  47.         for(int j = 0; j < size; j ++)
  48.             cout << arr[i][j] << " ";
  49.         cout << endl;
  50.     }
  51.      
  52. }
  53.  
  54.  
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement