版本比较
某自己在学校整的五子棋
正文
增加 13 行删除 13 行
17 行未改动18192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475762 行未改动79808182838485868715 行未改动10310410510610710810911011111218 行未改动17 行未改动bool move = 0, used[114][114];inline bool check(int x, int y, char ch) {if (ch == '.') return 0; // fuckkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkif (mp[x - 1][y] == ch)if (mp[x - 2][y] == ch)if (mp[x - 3][y] == ch)if (mp[x - 4][y] == ch)return 1;if (mp[x + 1][y] == ch)if (mp[x + 2][y] == ch)if (mp[x + 3][y] == ch)if (mp[x + 4][y] == ch)return 1;if (mp[x - 1][y - 1] == ch)if (mp[x - 2][y - 2] == ch)if (mp[x - 3][y - 3] == ch)if (mp[x - 4][y - 4] == ch)return 1;if (mp[x - 1][y + 1] == ch)if (mp[x - 2][y + 2] == ch)if (mp[x - 3][y + 3] == ch)if (mp[x - 4][y + 4] == ch)return 1;if (mp[x + 1][y - 1] == ch)if (mp[x + 2][y - 2] == ch)if (mp[x + 3][y - 3] == ch)if (mp[x + 4][y - 4] == ch)return 1;if (mp[x + 1][y + 1] == ch)if (mp[x + 2][y + 2] == ch)if (mp[x + 3][y + 3] == ch)if (mp[x + 4][y + 4] == ch)return 1;if (mp[x][y - 1] == ch)if (mp[x][y - 2] == ch)if (mp[x][y - 3] == ch)if (mp[x][y - 4] == ch)return 1;if (mp[x][y + 1] == ch)if (mp[x][y + 2] == ch)if (mp[x][y + 3] == ch)if (mp[x][y + 4] == ch)return 1;return 0;}signed main() {2 行未改动printf(" ");for (int i = 1; i <= 30; ++i) {printf("%lld", i);if (i < 10) putchar(' ');}putchar('\n');for (int i = 1; i <= 30; ++i) {if (i < 10) putchar(' ');printf("%lld", i);15 行未改动cnt ++;}if (!move) mp[x][y] = 'O', system("color 70");else mp[x][y] = 'X', system("color 07");for (int k = 1; k <= 30; ++k)for (int l = 1; l <= 30; ++l)if (check(k, l, mp[k][l])) {system("color 46");system("cls");18 行未改动17 行未改动18192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475762 行未改动79808182838485868715 行未改动10310410510610710810911011111218 行未改动17 行未改动bool move = 0, used[114][114];inline bool check(int x, int y, char ch) {if (ch == '.') return 0; // fuckkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkif (mp[x - 1][y] == ch)if (mp[x - 2][y] == ch)if (mp[x - 3][y] == ch)if (mp[x - 4][y] == ch)return 1;if (mp[x + 1][y] == ch)if (mp[x + 2][y] == ch)if (mp[x + 3][y] == ch)if (mp[x + 4][y] == ch)return 1;if (mp[x - 1][y - 1] == ch)if (mp[x - 2][y - 2] == ch)if (mp[x - 3][y - 3] == ch)if (mp[x - 4][y - 4] == ch)return 1;if (mp[x - 1][y + 1] == ch)if (mp[x - 2][y + 2] == ch)if (mp[x - 3][y + 3] == ch)if (mp[x - 4][y + 4] == ch)return 1;if (mp[x + 1][y - 1] == ch)if (mp[x + 2][y - 2] == ch)if (mp[x + 3][y - 3] == ch)if (mp[x + 4][y - 4] == ch)return 1;if (mp[x + 1][y + 1] == ch)if (mp[x + 2][y + 2] == ch)if (mp[x + 3][y + 3] == ch)if (mp[x + 4][y + 4] == ch)return 1;if (mp[x][y - 1] == ch)if (mp[x][y - 2] == ch)if (mp[x][y - 3] == ch)if (mp[x][y - 4] == ch)return 1;if (mp[x][y + 1] == ch)if (mp[x][y + 2] == ch)if (mp[x][y + 3] == ch)if (mp[x][y + 4] == ch)return 1;return 0;}signed main() {2 行未改动printf(" ");for (int i = 1; i <= 30; ++i) {printf("%lld", i);if (i < 10) putchar(' ');}putchar('\n');for (int i = 1; i <= 30; ++i) {if (i < 10) putchar(' ');printf("%lld", i);15 行未改动cnt ++;}if (!move) mp[x][y] = 'O', system("color 70");else mp[x][y] = 'X', system("color 07");for (int k = 1; k <= 30; ++k)for (int l = 1; l <= 30; ++l)if (check(k, l, mp[k][l])) {system("color 46");system("cls");18 行未改动