{ HADAJ_CISLO.PAS Copyright (c) Michael Gloger } { Program generuje nahodne cisla od 1 po 9, ktore padaju smerom na } { dol. Vasou ulohou je stlacat dane cisla na numerickej klavesnici } { pred tym ako padnu. Rychlost a pocet bodov za stlacene } { tlacitko sa postupne zvysuje. } { } { Datum:13.01.2007 http://www.trsek.com } program tuxtype; uses crt; var x,y,c,skore:integer; z:char; del:integer; begin writeln(' (C) Michael Gloger'); writeln(''); Writeln('Program generuje nahodne cisla od 1 po 9, ktore padaju smerom na dol'); Writeln('Vasou ulohou je stlacat dane cisla na numerickej klavesnici pred tym ako padnu.'); writeln('Rychlost a pocet bodov za stlacene tlacitko sa postupne zvysuje.'); textcolor(yellow); writeln(''); writeln('Stlac akukolvek klavesu'); textcolor(lightgray); readkey; clrscr; skore:=0; del:=300; repeat randomize; c:=random(9)+1; x:=random(10)+10; y:=1; del:=del-5; repeat gotoxy(1,3); writeln('Skore: ',skore); delay(del); clrscr; gotoxy(x,y); textcolor(yellow); write(c); gotoxy(1,1); textcolor(lightgray); writeln('様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様'); y:=y+1; if keypressed then z:=readkey; if(ord(z)-ord('0')=c)then begin if (del<=300) and (del>200) then skore:=skore+1; if (del<=200) and (del>100) then skore:=skore+3; if (del<=100) and (del>0) then skore:=skore+7; end until (ord(z)-ord('0')=c) or (y=26); until (y=26); textcolor(yellow); gotoxy(20,13); if (skore>=5) or (skore=0) then write('Ziskal si ', skore ,' bodov'); if (skore<5) and (skore>0) then write('Ziskal si ', skore ,' body'); textcolor(black); readln; end.