Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. const char Obstacle = '/';
  2.  
  3. //!alias to the black color
  4. const string KBlack = "40";
  5.  
  6. void ObstacleMap (CMatrix & Mat)
  7. {
  8. for(unsigned i(0); i<32; i++)
  9. {
  10. CPosition PosObstacle[i];
  11. PosObstacle[i].first = 10;
  12. PosObstacle[i].second = i;
  13. Mat [PosObstacle[i].first][PosObstacle[i].second] = Obstacle;
  14. }
  15. for(unsigned j(0); j<32; j++)
  16. {
  17. CPosition PosObstacle[j];
  18. PosObstacle[j].first = 10;
  19. PosObstacle[j].second = j + 68;
  20. Mat [PosObstacle[j].first][PosObstacle[j].second] = Obstacle;
  21. }
  22. for(unsigned h(0); h<32; h++)
  23. {
  24. CPosition PosObstacle[h];
  25. PosObstacle[h].first = 30;
  26. PosObstacle[h].second = h;
  27. Mat [PosObstacle[h].first][PosObstacle[h].second] = Obstacle;
  28. }
  29. for(unsigned k(0); k<32; k++)
  30. {
  31. CPosition PosObstacle[k];
  32. PosObstacle[k].first = 30;
  33. PosObstacle[k].second = k + 68;
  34. Mat [PosObstacle[k].first][PosObstacle[k].second] = Obstacle;
  35. }
  36. for(unsigned l(0); l<50; l++)
  37. {
  38. CPosition PosObstacle[l];
  39. PosObstacle[l].first = 20;
  40. PosObstacle[l].second = l + 25;
  41. Mat [PosObstacle[l].first][PosObstacle[l].second] = Obstacle;
  42. }
  43. }
  44.  
  45. void InitMat (CMatrix & Mat, unsigned NbLine, unsigned NbColumn, CPosition & PosPlayer1)
  46. {
  47. Mat.resize (NbLine);
  48. const CVLine KLine (NbColumn, KEmpty);
  49. for (CVLine &ALine : Mat)
  50. ALine = KLine;
  51.  
  52. PosPlayer1.first = 0;
  53. PosPlayer1.second = NbColumn - 1;
  54. Mat [PosPlayer1.first][PosPlayer1.second] = KTokenPlayer1;
  55.  
  56. ObstacleMap(Mat);
  57. }//InitMat ()
  58.  
  59.  
  60. case Obstacle:
  61. Color (KBlack);
  62. cout << c;
  63. Color (KReset);
  64. break;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement