Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- / SHAHMATY.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include "iostream"
- enum col { a, b, c, d, e, f, g, h };
- class figure{
- protected:
- int position_col, position_row;
- bool white;
- public:
- void set_position(int col, int row) {
- position_col = col;
- position_row = row;
- }
- void get_position() {
- char col;
- switch (position_col) {
- case 0:
- col = 'a';
- break;
- case 1:
- col = 'b';
- break;
- case 2:
- col = 'c';
- break;
- case 3:
- col = 'd';
- break;
- case 4:
- col = 'e';
- break;
- case 5:
- col = 'f';
- break;
- case 6:
- col = 'g';
- break;
- case 7:
- col = 'h';
- break;
- };
- std::cout << col;
- std::cout << position_row;
- }
- };
- class pawn : public figure {
- white = true;
- bool on_first_line = true;
- bool move_is_possible(int col, int row) {
- if (on_first_line) if (white) return true;
- }
- };
- int main()
- {
- int chessboard[8][9];
- figure obj1;
- obj1.set_position(f, 1);
- obj1.get_position();
- std::cout <<"\n";
- system("pause");
- return 0;
- chessboard[a][1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement