home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / qtawk / cliche.exp < prev    next >
Text File  |  1989-03-15  |  298b  |  18 lines

  1. # cliche - generate an endless stream of cliches
  2. # AWK page 113
  3. BEGIN {
  4.     FS = ":";
  5.     srand();
  6. }
  7.     {
  8.     x[NR] = $1;
  9.     y[NR] = $2;
  10. }
  11. END {
  12.     for ( i = 1 ; i < 200 ; i++ )
  13.       print x[randint(NR)],y[randint(NR)];
  14. }
  15. function randint(n){
  16.     return int(n * rand()) + 1;
  17. }
  18.