Friday, December 17, 2004
What running a BBS was really all about
/****************************************
GIRL.C
female detector for WWIV 4.xx
by Jeff Robertson
This is a simpler variant of ALERT.C
that beeps when a female user logs on.
It must be located in the same directory
as your CHAIN.TXT file.
****************************************/
#include <stdio.h>
#include <dos.h>
#define DESIRED_SEX "F"
#define CHAIN_FILE "chain.txt"
#define READ "r"
#define SEX_LINE 6
int x;
char line[30];
FILE *chain_file;
int main()
{
chain_file = fopen( CHAIN_FILE, READ);
if ( chain_file == NULL ) exit(1);
for( x = SEX_LINE ; x ; x-- )
/* go through the lines before the sex line */
(void) fgets(line, sizeof(line), chain_file);
line[ strlen(line) - 1] = '\0';
if ( strcmp( line, DESIRED_SEX ) == 0)
{
for (x=5; x; x--)
{
(void) sound(500);
(void) delay(100);
(void) sound(1000);
(void) delay(100);
}
(void) nosound();
}
return (0);
}
GIRL.C
female detector for WWIV 4.xx
by Jeff Robertson
This is a simpler variant of ALERT.C
that beeps when a female user logs on.
It must be located in the same directory
as your CHAIN.TXT file.
****************************************/
#include <stdio.h>
#include <dos.h>
#define DESIRED_SEX "F"
#define CHAIN_FILE "chain.txt"
#define READ "r"
#define SEX_LINE 6
int x;
char line[30];
FILE *chain_file;
int main()
{
chain_file = fopen( CHAIN_FILE, READ);
if ( chain_file == NULL ) exit(1);
for( x = SEX_LINE ; x ; x-- )
/* go through the lines before the sex line */
(void) fgets(line, sizeof(line), chain_file);
line[ strlen(line) - 1] = '\0';
if ( strcmp( line, DESIRED_SEX ) == 0)
{
for (x=5; x; x--)
{
(void) sound(500);
(void) delay(100);
(void) sound(1000);
(void) delay(100);
}
(void) nosound();
}
return (0);
}