home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / bix / lotto.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-08-04  |  810 b   |  40 lines

  1. {Ok, Barry, MegaBucks looks nifty and here's NY's LOTTO version written
  2. for CGA with my usual lack of commentation. (They see how we waste our
  3. time and some of our money)! - Jim}
  4.  
  5. program lotto;
  6. var i,j,k,l,m:integer;
  7.     c:char;
  8.     r:set of 0..255;
  9.     s:string[255];
  10. begin
  11. textmode(c40);
  12. textcolor(white);
  13. write('Enter 40 or 48.....');readln(m);
  14. repeat
  15. writeln;
  16. i:=m;
  17. r:=[];
  18. randomize;
  19. s:='';
  20. for j:=1 to i do s:=s+chr(j);
  21. for j:=1 to 6 do
  22.  begin
  23.   k:=random(i)+1;
  24.   l:=ord(s[k]);
  25.   delete(s,k,1);
  26.   r:=r+[l];
  27.   i:=i-1
  28.  end;
  29.  for k:=1 to m do
  30.   begin
  31.    if k in r then textcolor(red) else textcolor(white);
  32.    write(k:5);
  33.    if k mod 8 = 0 then writeln
  34.   end;
  35.  writeln;
  36.  write('more?   (enter y or n)....');readln(c);
  37.  until (c='n') or (c='N');
  38.  textmode(c80);
  39.  end..
  40.