program folyadek; uses {newdelay}crt,graph; var j : integer; { * * * * * } procedure begraf; const path ='c:\tp\bgi'; var gd,gm :integer; begin detectgraph(gd,gm); initgraph(gd,gm,path); end; { * * * * * } procedure kigraf; begin closegraph; end; { * * * * * } procedure kezdokep; var i : integer; st : string; begin cleardevice; setbkcolor(1); setcolor(white); setfillstyle(solidfill,white); bar(70,50,285,250); {szimul ci¢s t‚r} setcolor(blue); bar(590,20,630,30); {sz ml l¢ ablak} bar(20,440,620,470); {funkci¢ ablak} setcolor(white); line(380,50,380,250); {koordin ta} line(360,250,600,250); {tengelyek} outtextxy(300,20,'folyadek'); for i:=0 to 6 do begin { x egys‚gek} str(i,st); outtextxy(395+i*30,270,st); end; setcolor(blue); outtextxy(515,451,'ind¡t s: [r]'); outtextxy(410,451,' llj: [s]'); outtextxy(295,451,'v‚ge: [e]'); outtextxy(25,451,'['#$1b'] lass¡t s -'); outtextxy(146,451,'gyors¡t s ['#$1a']'); outtextxy(34,462,'1'); outtextxy(230,462,'39'); outtextxy(125,462,'31'); outtextxy(595,22,'0'); setcolor(white); outtextxy(123,300,'6'); outtextxy(223,300,'0'); outtextxy(483,300,'0'); end; { * * * * * } procedure vezerles(var ch:char;var t:integer); var st :string; begin if ord(ch)=115 then repeat ch:=readkey; until (ord(ch)=114) or (ord(ch)=101); if ord(ch)=101 then halt; repeat if ord(ch)=77 then begin {gyors¡t s} t:=t-100; if t<50 then t:=50; setfillstyle(solidfill,white); bar(120,460,150,470); setcolor(blue); str((200-(t div 10)) div 5,st); outtextxy(125,462,st); ch:=' '; end; if keypressed then ch:=readkey; until ord(ch)<>77; repeat if ord(ch)=75 then begin {lass¡t s} t:=t+100; if t>1950 then t:=1950; setfillstyle(solidfill,white); bar(120,460,150,470); setcolor(blue); str((200-(t div 10)) div 5,st); outtextxy(125,462,st); ch:=' '; end; if keypressed then ch:=readkey; until ord(ch)<>75; end; { * * * * * } procedure szimulac; label ujra; var i,k,t :integer; ter :array[-1..51,-1..60] of integer; ch :char; begin ujra: k:=0; {szim. l‚p‚ssz m} t:=450; { ‚rt‚kad s >> } randomise; for i:=1 to 199 do for j:=1 to 214 do begin if random(1)>0.7 then ter[i,j]:=1 else ter[i,j]:=0; putpixel(70+i,50+j, black); end; { >> ‚rt‚kad s } repeat ch:=readkey; until (ord(ch)=114)or(ord(ch)=101)or(ord(ch)=75)or(ord(ch)=77); repeat vezerles(ch,t); until (ord(ch)=114)and(ord(ch)<>101)and(ord(ch)<>75)and(ord(ch)<>77); for j :=1 to 350 do begin {maxim lt l‚p‚ssz m} if keypressed then ch:=readkey; {str(ord(ch),st); outtextxy(300,400,st);delay(4000);} vezerles(ch,t); delay(t); {k‚sleltet‚s} end; repeat ch:=readkey; until (ord(ch)=101)or(ord(ch)=114); if ord(ch)=114 then begin kezdokep; goto ujra; end; end; { * * * * * } begin begraf; kezdokep; szimulac; kigraf; end.