home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CPM68K / SNOBOL4.LBR / RPOEM.C < prev    next >
Text File  |  2000-06-30  |  896b  |  45 lines

  1. /* -*-c,save-*- */
  2. /*
  3.  * rpoem.c - random poetry program
  4.  * Robert Heller. Created: Sun Feb 23, 1986 13:17:54.77
  5.  * Last Mod: 
  6.  * 
  7.  * (c) Copyright 1986 by Robert Heller
  8.  *     All Rights Reserved
  9.  * 
  10.  * 
  11.  */
  12. #include <stdio.h>
  13.  
  14. #define SYNFILE "RPOEM.SYN"
  15.  
  16. char poem_buff[8192];
  17.  
  18. main()
  19. {
  20.     register int count;
  21.  
  22.     rsent_init(SYNFILE);
  23.     srand(gettime());
  24.     for (count=0;count<30;count++) {
  25.     rsentence("<RPOEM>",poem_buff);
  26.     printf("------------------------------------------\nVerse %d\n",
  27.            count+1);
  28.     printl(poem_buff);
  29.     }
  30.     printf("------------------------------------------\n");
  31.     }
  32. printl(buff)
  33. register char *buff;
  34. {
  35.     while (*buff != '\0') {
  36.     if (*buff != '\\') putchar(*buff);
  37.     else {
  38.         buff++;
  39.         if (*buff == 'n') putchar('\n');
  40.         else putchar(*buff);
  41.         }
  42.     buff++;
  43.     }
  44.     }
  45.