uses vga_lib,crt; var x,y,x2,y2:integer; klaw,tn:char; szyb:shortint; kier,kier2:byte; wynik,wynikII:integer; wyniks,wyniksII:string; imie,imie2:string; ilosc,il:byte; procedure witam; begin clrscr; gotoxy(34,12); textcolor(green); writeln('DzDzoFnice'); gotoxy(22,13); textcrt('Karol Bonenberg ¯ 19.3.1998 Poznan',12,1,60,1); gotoxy(23,14); textcrt(' ;)',11,1,70,1 ); delay(666); end; procedure menu; begin clrscr; write('Podaj imie gracza numer 1 : '); readln(imie); write('OK, a teraz podaj imie gracza numer 2 : '); readln(imie2); write('A teraz, podaj szybkosc gry (im mniejsza wartosc, tym szybsza gra) : '); readln(szyb); write('Ile gier?(max 255) : '); readln(il); writeln; writeln('Ustawienia klawiszy dla gracza ',imie,' : '); writeln('gora - W, dol - S, lewo - A, prawo - D'); writeln; writeln('Ustawienia klawiszy dla gracza ',imie2,' : '); writeln('gora - strzalka w gore, dol - strzalka w dol, lewo - strzalka w lewo, prawo - strzalka w prawo'); readln; end; procedure czytaj; begin klaw:=readkey; case klaw of {g} #72 :kier2:=1; {d} #80 :kier2:=2; {l} #75 :kier2:=3; {p} #77 :kier2:=4; {w} #119:kier:=1; {s} #115:kier:=2; {a} #97 :kier:=3; {d} #100:kier:=4; end; end; procedure przegrana(numgracza: word); begin ilosc:=ilosc+1; cls(0); dzwiek(100,50); nosound; kier:= 4; kier2:= 3; x:=50; y:=100; x2:=300; y2:=100; if numgracza<>0 then begin if numgracza=1 then inc(WynikII) else inc(Wynik); end; end; procedure zegnam; begin clrscr; textcrt('Karol Bonenberg - email : naildr@kki.net.pl',11,50,40,1); delay(500); exit; end; procedure glowne; begin init; kier:=4; kier2:=3; x:=50; y:=100; x2:=300; y2:=100; wynik:=0; wynikII:=0; repeat if keypressed then czytaj; case kier of 1:dec(y); 2:inc(y); 3:dec(x); 4:inc(x); end; case kier2 of 1:dec(y2); 2:inc(y2); 3:dec(x2); 4:inc(x2); end; if (x=x2) and (y=y2) then przegrana(0); if (x=0) or (y=12) or (y=199) or (x=315) or (getplot(x,y)<>0 ) then przegrana(1) else if (x2=0) or (y2=12) or (x2=315) or (y2=199) or (getplot(x2,y2)<>0) then przegrana(2) ; str(wynik,wyniks); str(wynikII,wyniksII); box(0,13,315,199,4); print(1,1,3,'DzDzoFnice'); print(110,1,6,imie); print(220,1,2,imie2); print(190,1,6,wyniks); print(300,1,2,wyniksII); plot(x,y,6); plot(x2,y2,2); delay(szyb); until ilosc=il; clinit; end; procedure wyniki; begin if wynik>wynikII then begin textcrt('And the winner is... ',2,0,100,1); write(imie,'!!!'); delay(360) end; if wynikII>wynik then begin textcrt('And the winner is... ',2,0,100,1); write(imie2,'!!!'); delay(360); end; if (wynikII<>0) and (wynik<>0) and (wynik=wynikII) then begin textcrt('REMIS ! ',2,0,100,1); end; end; begin witam; menu; glowne; wyniki; zegnam; end.