Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. / SHAHMATY.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "iostream"
  6. enum col { a, b, c, d, e, f, g, h };
  7. class figure{
  8. protected:
  9. int position_col, position_row;
  10. bool white;
  11. public:
  12. void set_position(int col, int row) {
  13. position_col = col;
  14. position_row = row;
  15. }
  16. void get_position() {
  17. char col;
  18. switch (position_col) {
  19. case 0:
  20. col = 'a';
  21. break;
  22. case 1:
  23. col = 'b';
  24. break;
  25. case 2:
  26. col = 'c';
  27. break;
  28. case 3:
  29. col = 'd';
  30. break;
  31. case 4:
  32. col = 'e';
  33. break;
  34. case 5:
  35. col = 'f';
  36. break;
  37. case 6:
  38. col = 'g';
  39. break;
  40. case 7:
  41. col = 'h';
  42. break;
  43. };
  44. std::cout << col;
  45. std::cout << position_row;
  46.  
  47. }
  48.  
  49. };
  50. class pawn : public figure {
  51. white = true;
  52. bool on_first_line = true;
  53. bool move_is_possible(int col, int row) {
  54. if (on_first_line) if (white) return true;
  55. }
  56. };
  57. int main()
  58. {
  59. int chessboard[8][9];
  60. figure obj1;
  61. obj1.set_position(f, 1);
  62. obj1.get_position();
  63. std::cout <<"\n";
  64. system("pause");
  65. return 0;
  66. chessboard[a][1];
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement