Académique Documents
Professionnel Documents
Culture Documents
h"
#include <iostream>
#include<string>
#include<map>
#include<vector>
#include<algorithm>
#include<list>
#include<math.h>
typedef long long int ll;
using namespace std;
bool ismoveghora(pair<char, char> arr[][8], int s1, int s2, int d1, int d2)
{
int dx[] = {-2,-1,1,2,2,1,-1,-2};
int dy[] = {1,2,2,1,-1,-2,-2,-1};
bool ismovehaathi(pair<char, char> arr[][8], int s1, int s2, int d1, int d2)
{
if (s1 == d1 && s2 != d2)//same row
{
for (int i = min(s2, d2)+1; i < max(s2, d2); i++)
{
if (arr[s1][i].first != '0')
{
cout << "row me kuch h beech me";
return false;
}
}
}
if (s1 != d1 && s2 == d2)//same col
{
for (int i = min(s1, d1)+1; i < max(s1, d1); i++)
{
if (arr[i][s2].first != '0') {
cout << "col me kuch h beech me";
return false;
}
}
}
return true;
bool ismovepyada(pair<char, char> arr[][8], int s1, int s2, int d1, int d2)
{
void update_pos(pair<char, char> arr[][8], int s1, int s2, int d1, int d2)
{
arr[d1][d2].second = arr[s1][s2].second;
arr[d1][d2].first = arr[s1][s2].first;
arr[s1][s2].first = '0';
arr[s1][s2].second = '0';
}
int main()
{
int t;
cin >> t;
pair<char, char> arr[8][8];
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
if (i == 1)
{
arr[i][j].first = 'p';
arr[i][j].second = 'a';
}
else if (i == 6)
{
arr[i][j].first = 'p';
arr[i][j].second = 'b';
}
else
{
arr[i][j].first = '0';
arr[i][j].second = '0';
}
}
}
arr[0][0].first = 'h';
arr[0][0].second = 'a';
arr[0][7].first = 'h';
arr[0][7].second = 'a';
arr[0][1].first = 'g';
arr[0][1].second = 'a';
arr[0][6].first = 'g';
arr[0][6].second = 'a';
arr[7][0].first = 'h';
arr[7][0].second = 'b';
arr[7][7].first = 'h';
arr[7][7].second = 'b';
arr[7][1].first = 'g';
arr[7][1].second = 'b';
arr[7][6].first = 'g';
arr[7][6].second = 'b';
while (t--)
{
int s1, s2, d1, d2;
cout << "enter source coordinates: ";
cin >> s1 >> s2;
cout << "enter destination coordinates " << endl;
cin >> d1 >> d2;
}
cout << endl;
}
return 0;
}