home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kompon / d23456 / CAJSCRTP.ZIP / demo_kylix / test5.ifs < prev    next >
Text File  |  2000-05-15  |  526b  |  22 lines

  1. Program CajScriptTest;
  2. var
  3.   Items : Array of String;
  4.   I, No : Integer;
  5.   s : string;
  6. Begin
  7.   Writeln('Type in the number of players:');
  8.   Readln(s);
  9.   no:=StrToInt(S, -1);
  10.   if no<=0 then begin
  11.    Writeln('Illegal number of players!');
  12.   end else begin
  13.     SetArrayLength(Items, No);
  14.     For i:=0 to no-1 do Begin
  15.       Writeln('Type name for player '+inttostr(i+1));
  16.       Readln(items[I]);
  17.     end;
  18.     no:=Random(no);
  19.     Writeln(Items[no]+' ('+inttostr(no+1)+') wins this small game!');
  20.   end;
  21. End.
  22.