program robot ; uses crt ; var a:integer ; g:char; Procedure kesz ; Begin gotoXY(10,11); WriteLn('Frissˇt‚s.') ; End; Procedure allj ; Begin Port[$378]:= 0 ; End; Procedure elore ; Begin gotoXY(10,10); WriteLn('El‹re megyek. ') ; Port[$378]:= 2 ; End; Procedure hatra ; Begin gotoXY(10,10); WriteLn('H tra megyek. ') ; Port[$378]:= 1 ; End ; {el‹re halad skor a sima " llj" csak a morrot  llˇtja le a kocsi megy tov bb el‹re. A stooop el‹re halad sb˘l r”gt”n meg llˇtja a kocsit. } Procedure stooop ; Begin Port[$378]:= 1 ; Delay(550) ; End ; Procedure hstooop ; begin Port[$378]:= 2 ; Delay(300) ; End; Procedure ebalra ; Begin gotoXY(10,10); WriteLn('El‹re ‚s balra megyek. ') ; Port[$378]:= 10 ; End; Procedure hbalra ; begin gotoXY(10,10); WriteLn('H tra ‚s balra megyek. ') ; Port[$378]:= 9 ; End; Procedure ejobbra ; Begin gotoXY(10,10); WriteLn('El‹re ‚s jobbra megyek. ') ; Port[$378]:= 6 ; End ; Procedure hjobbra ; Begin gotoXY(10,10); WriteLn('H tra ‚s jobbra megyek. ') ; Port[$378]:=5 ; End ; Procedure fordulj ; Begin GotoxY(10,11) ; Textcolor(2) ; Write('Megfordulok.') ; Gotoxy(10,12) ; WriteLn('Pill...') ; Textcolor(14) ; ejobbra ; Delay(1200) ; hbalra ; Delay(1350) ; allj ; Delay(1000) ; ejobbra ; Delay(1000) ; Textcolor(2) ; Gotoxy(10,10) ; Write('Megfordultam. ') ; Textcolor(7) ; GotoxY(10,11) ; Write(' ') ; Gotoxy(10,12) ; Write(' ') ; Gotoxy(10,10) ; allj ; End; begin Randomize ; a:=random(5000) ; if a=2 then a:= 8; textbackground(a) ; clrscr; Textcolor(12) ; GotoxY(20,10) ; Write(' Kapcsold BE a Num Lock ot!!!!!!') ; Textcolor(14) ; GotoxY(20,11) ; Write(' Ha k‚sz vagy k‚rlek nyomj 1 ENTER-t') ; GotoxY(20,12) ; Write(' K”sz”n”m!') ; GotoxY(10,10) ; ReadLn; Clrscr ; WriteLn('A Num Lock gombjaival tudsz ir nyˇtani') ; WriteLn('1-es H tra ‚s balra megyek.') ; WriteLn('2-es H tra megyek.') ; WriteLn('3-as H tra ‚s jobbra megyek.') ; WriteLn('4-es Balra fordulok.') ; WriteLn('5-”s Megfordulok.') ; WriteLn('6-os Jobbra fordulok') ; WriteLn('7-es El‹re ‚s balra megyek.') ; WriteLn('8-as El‹re megyek.') ; WriteLn('9-es El‹re ‚s jobbra megyek.') ; readkey; clrscr; repeat if keypressed then begin g:=readkey; if g=#56 then begin elore ; end; if g=#50 then begin hatra ; end; if g=#55 then begin ebalra ; end; if g=#57 then begin ejobbra ; end; if g=#49 then begin hbalra ; end; if g=#51 then begin hjobbra ; end; if g=#53 then begin fordulj ; allj ; end; if g=#52 then begin gotoXY(10,10); WriteLn('Jobbra fordulok') ; Port[$378]:= 8; end ; if g=#54 then begin gotoXY(10,10); WriteLn('Balra fordulok') ; Port[$378]:= 4 ; End ; Gotoxy(10,11) ; Write(' ') ; Gotoxy(10,12) ; Write(' ') ; GotoxY(10,10) ; Textcolor(14) ; Delay(120) ; allj ; end; Until (g=#27) or (g='s'); End.