#include #include #include /* sleep */ /* * Exercises every conio function: * clrscr — clear the screen * gotoxy — move cursor to (x, y), 0-based * putch — single character * cputs — string without auto-newline * kbhit — non-blocking key probe * getch — blocking, no echo * getche — blocking, with echo * * Sprinter native text mode is 80×32, so we anchor corners at * (0,0), (79,0), (0,31), (79,31). */ int main(void) { /* 1. clrscr + diagnostic probes + a centered banner. * * Row-0 probe: figure out why [NW]/[NE] don't paint. * '0','1','2','3' — single putch at row 0, cols 0/5/40/79 * "R0" — cputs at row 0, col 10 * 'a','b','c','R1'— same pattern on row 1 (control) */ clrscr(); gotoxy(0, 0); putch('0'); textattr(0x70); gotoxy(1, 0); putch('1'); set_putch_raw_mode(1); textattr(0x0F); gotoxy(4, 3); for (int i = 0; i < 16; i++) { putch(i < 10 ? '0' + i : 'A' - 10 + i); putch(' '); } for (int j = 0; j < 16; j++) { gotoxy(2, 4 + j); textattr(0x0F); putch(j < 10 ? '0' + j : 'A' - 10 + j); putch(' '); for (int i = 0; i < 16; i++) { textattr((j << 4) + i); putch((j << 4) + i); putch(' '); } } set_putch_raw_mode(0); gotoxy(0,22); set_text_attr(0x000E); // cputs("Test message line"); cputs("Test message line 1\nTest message line2\rline3\n\r\n\r1234\t5678\b90"); (void)getch(); return 0; }