Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
50
Добавлен:
28.12.2016
Размер:
656 б
Скачать
#include <conio.h> 
#include <dos.h> 

void main()
{
	union REGS regs;
	regs.h.dl = '*';
	
	textbackground(GREEN);
	clrscr();
	window(15, 10, 65, 20);
	textbackground(YELLOW);
	clrscr();
	textcolor(BLACK);
        _setcursortype (_NOCURSOR);

	int x = 1, y = 1;
	do
	{
		regs.h.ah = 7;
		int86(0x21, &regs, &regs);
		switch (regs.h.al)
		{
		    case 72: if (y > 1) { y--; } break;
		    case 75: if (x > 1) { x--; } break;
		    case 77: if (x <= 50) { x++; } break;
		    case 80: if (y <= 10) { y++; } break;
		}
		clrscr();
		gotoxy(x, y);
		regs.h.ah = 2;
		int86(0x21, &regs, &regs);
	} while (regs.h.al != 32);
}

Соседние файлы в папке ОргЭВМ(лабы 1-5)