#include int pole[77][77]; int n_x, n_y; int is_conflict(int x, int y, int co) { if (pole[y][x] == ' ') return co; if (pole[y][x] == co ) return co; if ((pole[y][x] == '|') && (co == '-')) return '+'; if ((pole[y][x] == '-') && (co =='|')) return '+'; if ((pole[y][x] == '/') && (co == '\\')) return 'x'; if ((pole[y][x] == '\\') && (co == '/')) return 'x'; return '*'; } int write(int x, int y, int co) { int result; result = is_conflict(x, y, co); pole[y][x] = result; } void draw_point(int x, int y) { write(x, y, 'o'); } int draw_line(x1, y1, x2, y2) { int tmpx1, tmpx2, tmpy1, tmpy2, i, pos; if (y1 == y2) { if (x1 <= x2) { tmpx1 = x1; tmpx2 = x2; } else { tmpx1 = x2; tmpx2 = x1; } pos = tmpx2- tmpx1; for (i = 0; i <= pos; i++ ) { write(tmpx1+i, y1, '-'); } return 1; } if (x1 == x2) { if (y1 <= y2) { tmpy1 = y1; tmpy2 = y2; } else { tmpy1 = y2; tmpy2 = y1; } pos = tmpy2 - tmpy1; for (i = 0; i <= pos; i++) { write(x1, tmpy1+i, '|'); } return 1; } if (x1 < x2) { tmpx1 = x1; tmpx2 = x2; } else { tmpx1 = x2; tmpx2 = x1; } pos = tmpx2-tmpx1; if (y1 < y2) { for (i = 0; i <= pos; i++ ) { write(tmpx1 + i, y1 + i, '\\'); } } else { for (i = 0; i <= pos; i++) { write(tmpx1 +i, y1 - i, '/'); } } } void clear(int x1, int y1, int x2, int y2) { int tmpx1, tmpx2; int tmpy1, tmpy2; int i, j; if (x1