Advertisement
Te4nick

chss.cpp

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