Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const char Obstacle = '/';
- //!alias to the black color
- const string KBlack = "40";
- void ObstacleMap (CMatrix & Mat)
- {
- for(unsigned i(0); i<32; i++)
- {
- CPosition PosObstacle[i];
- PosObstacle[i].first = 10;
- PosObstacle[i].second = i;
- Mat [PosObstacle[i].first][PosObstacle[i].second] = Obstacle;
- }
- for(unsigned j(0); j<32; j++)
- {
- CPosition PosObstacle[j];
- PosObstacle[j].first = 10;
- PosObstacle[j].second = j + 68;
- Mat [PosObstacle[j].first][PosObstacle[j].second] = Obstacle;
- }
- for(unsigned h(0); h<32; h++)
- {
- CPosition PosObstacle[h];
- PosObstacle[h].first = 30;
- PosObstacle[h].second = h;
- Mat [PosObstacle[h].first][PosObstacle[h].second] = Obstacle;
- }
- for(unsigned k(0); k<32; k++)
- {
- CPosition PosObstacle[k];
- PosObstacle[k].first = 30;
- PosObstacle[k].second = k + 68;
- Mat [PosObstacle[k].first][PosObstacle[k].second] = Obstacle;
- }
- for(unsigned l(0); l<50; l++)
- {
- CPosition PosObstacle[l];
- PosObstacle[l].first = 20;
- PosObstacle[l].second = l + 25;
- Mat [PosObstacle[l].first][PosObstacle[l].second] = Obstacle;
- }
- }
- void InitMat (CMatrix & Mat, unsigned NbLine, unsigned NbColumn, CPosition & PosPlayer1)
- {
- Mat.resize (NbLine);
- const CVLine KLine (NbColumn, KEmpty);
- for (CVLine &ALine : Mat)
- ALine = KLine;
- PosPlayer1.first = 0;
- PosPlayer1.second = NbColumn - 1;
- Mat [PosPlayer1.first][PosPlayer1.second] = KTokenPlayer1;
- ObstacleMap(Mat);
- }//InitMat ()
- case Obstacle:
- Color (KBlack);
- cout << c;
- Color (KReset);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement