/* $Id$ */
/* �o���}���p�{�� */

#include "bbs.h"

#define VICE_SHOW  BBSHOME "/etc/vice.show1"
#define VICE_BINGO BBSHOME "/etc/vice.bingo"
#define VICE_NEW   "vice.new"
#define VICE_DATA  "vice.data"
#define MAX_BINGO  99999999

int main(int argc, char **argv)
{
    char *TABLE[5] = {"�@", "�G", "�T", "�|", "��"};
    int i = 0, bingo, base = 0;


    FILE *fp = fopen(VICE_SHOW, "w"), *fb = fopen(VICE_BINGO, "w");

    // XXX: resolve_utmp();
    attach_SHM();

    srand(SHM->number);

    if (!fp || !fb )
	perror("error open file");


    bingo = rand() % MAX_BINGO;
    fprintf(fp, "%1c�Τ@�o���������X\n", ' ');
    fprintf(fp, "%1c================\n", ' ');
    fprintf(fp, "%1c�S�O��: %08d\n\n", ' ', bingo);
    fprintf(fb, "%d\n", bingo);

    while (i < 5)
    {
	bingo = (base + rand()) % MAX_BINGO;
	fprintf(fp, "%1c��%s��: %08d\n", ' ', TABLE[i], bingo);
	fprintf(fb, "%08d\n", bingo);
	i++;
    }
    fclose(fp);
    fclose(fb);
    return 0;
}