Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- char desk[9][10] = {
- {'1', 'r', 'n', 'b', 'q', 'k', 'b', 'n', 'r', '\n'},
- {'2', 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p', '\n'},
- {'3', '.', '.', '.', '.', '.', '.', '.', '.', '\n'},
- {'4', '.', '.', '.', '.', '.', '.', '.', '.', '\n'},
- {'5', '.', '.', '.', '.', '.', '.', '.', '.', '\n'},
- {'6', '.', '.', '.', '.', '.', '.', '.', '.', '\n'},
- {'7', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', '\n'},
- {'8', 'R', 'N', 'B', 'Q', 'K', 'B', 'N', 'R', '\n'},
- {' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', '\0'}};
- int main() {
- bool W = true;
- char in[5] = "d5e5";
- while ((in[0] != 'q') && (in[1] != 'u') && (in[3] != 'i') && (in[3] != 't')) {
- desk[in[3] - '1'][in[2] - 'a' + 1] = desk[in[1] - '1'][in[0] - 'a' + 1];
- desk[in[1] - '1'][in[0] - 'a' + 1] = '.';
- std::cout << desk[0] << "\n" << (W ? "W>>>" : "B>>>"); std::cin >> in; W = !W;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement