mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-23 08:24:18 +00:00
1 line
895 B
C
1 line
895 B
C
/* -*-c,save-*- */
|
||
|
||
/*
|
||
|
||
* rpoem.c - random poetry program
|
||
|
||
* Robert Heller. Created: Sun Feb 23, 1986 13:17:54.77
|
||
|
||
* Last Mod:
|
||
|
||
*
|
||
|
||
* (c) Copyright 1986 by Robert Heller
|
||
|
||
* All Rights Reserved
|
||
|
||
*
|
||
|
||
*
|
||
|
||
*/
|
||
|
||
#include <stdio.h>
|
||
|
||
|
||
|
||
#define SYNFILE "RPOEM.SYN"
|
||
|
||
|
||
|
||
char poem_buff[8192];
|
||
|
||
|
||
|
||
main()
|
||
|
||
{
|
||
|
||
register int count;
|
||
|
||
|
||
|
||
rsent_init(SYNFILE);
|
||
|
||
srand(gettime());
|
||
|
||
for (count=0;count<30;count++) {
|
||
|
||
rsentence("<RPOEM>",poem_buff);
|
||
|
||
printf("------------------------------------------\nVerse %d\n",
|
||
|
||
count+1);
|
||
|
||
printl(poem_buff);
|
||
|
||
}
|
||
|
||
printf("------------------------------------------\n");
|
||
|
||
}
|
||
|
||
printl(buff)
|
||
|
||
register char *buff;
|
||
|
||
{
|
||
|
||
while (*buff != '\0') {
|
||
|
||
if (*buff != '\\') putchar(*buff);
|
||
|
||
else {
|
||
|
||
buff++;
|
||
|
||
if (*buff == 'n') putchar('\n');
|
||
|
||
else putchar(*buff);
|
||
|
||
}
|
||
|
||
buff++;
|
||
|
||
}
|
||
|
||
}
|
||
|
||
|