Advertisement
WadeRollins2710

[App] Typing Test

Feb 28th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 3.25 KB | None | 0 0
  1. {You need a file named "TEXT.TXT" contains a paragraph, write in on the same line, don't enter or the program won't work}
  2. {This was made by Tran V.Anh AKA Wade Rollins}
  3. {DON'T STEAL THIS}
  4. Program Typing_Test;
  5. Uses crt;
  6. Var
  7.    St: Array [1..100] of String;
  8.    i, j, length, so: Integer;
  9. Procedure Pout(m: String; i: Integer);
  10.           Begin
  11.                Writeln(m);
  12.                Delay(i);
  13.           End;
  14. Procedure Intro;
  15.           Begin
  16.                clrscr;
  17.                Pout('You are good at 10 fingers-typing???',1000);
  18.                Pout('Well let''s test it now!!!',1000);
  19.           End;
  20. Procedure Title;
  21.           Begin
  22.                clrscr;
  23.                TextColor(Black);
  24.                TextBackGround(White);
  25.                For i:=1 to 25 do
  26.                    Writeln('                                                                                  ');
  27.                Gotoxy(33,1);
  28.                Write('T'); Delay(1000);
  29.                Write('Y'); Delay(1000);
  30.                Write('P'); Delay(1000);
  31.                Write('I'); Delay(1000);
  32.                Write('N'); Delay(1000);
  33.                Write('G '); Delay(1000);
  34.                Write('T'); Delay(1000);
  35.                Write('E'); Delay(1000);
  36.                Write('S'); Delay(1000);
  37.                Write('T'); Delay(1000);
  38.                Gotoxy(32,1); TextColor(115);
  39.                Write('Press Enter!!!');
  40.                Readln;
  41.                TextColor(Black);
  42.           End;
  43. Procedure ReadText;
  44.           Var
  45.              i, number: Integer;
  46.              LOL: String;
  47.              ch: char;
  48.              f: text;
  49.           Begin
  50.                length:=0;
  51.                Assign(f,'TEXT.TXT'); Reset(f);
  52.                i:=0; j:=1; LOL:='';
  53.                While not eof(f) do
  54.                      Begin
  55.                           Read(f,ch);
  56.                           LOL:=LOL+ch;
  57.                           i:=i+1; length:=length+1;
  58.                           If (i>=256) or (eof(f)) then
  59.                              Begin
  60.                                   St[j]:=LOL;
  61.                                   LOL:='';
  62.                                   j:=j+1; i:=0;
  63.                              End;
  64.                      End;
  65.                so:=j;
  66.           End;
  67. Procedure Typing;
  68.           Var
  69.              i, j, arr, k: Integer;
  70.              key: char;
  71.           Begin
  72.                clrscr; Writeln(length);
  73.                For i:=1 to so do
  74.                    Write(St[i]); Gotoxy(1,2);
  75.                j:=0; i:=1; arr:=1; k:=1;
  76.                Repeat
  77.                           key:=ReadKey;
  78.                           While (key<>St[arr][k]) and (key<>#27) do
  79.                                 Begin
  80.                                      key:=Readkey;
  81.                                 End;
  82.                           k:=k+1; j:=j+1;
  83.                           If k>=256 then
  84.                              Begin
  85.                                   arr:=arr+1;
  86.                                   k:=1;
  87.                              End;
  88.                           TextColor(Red);
  89.                           Write(key);
  90.                Until (j>=length) or (key=#27);
  91.           End;
  92. Begin
  93.      clrscr;
  94.      Intro;
  95.      Title;
  96.      ReadText;
  97.      Typing;
  98.      Readln;
  99. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement