KoF0.70/
KoF0.70/datafiles/old_datafiles/
KoF0.70/helpfiles/
KoF0.70/miscfiles/
KoF0.70/motds/motd1/
KoF0.70/motds/motd2/
KoF0.70/socfiles/
KoF0.70/textfiles/
KoF0.70/textfiles/adminfiles/
KoF0.70/userfiles/
KoF0.70/userfiles/friends/
KoF0.70/userfiles/historys/
KoF0.70/userfiles/macros/
KoF0.70/userfiles/mail/
KoF0.70/userfiles/profiles/
KoF0.70/userfiles/rooms/
KoF0.70/userfiles/userfiles/
KoF0.70/userfiles/userfiles/friends/
KoF0.70/userfiles/userfiles/historys/
KoF0.70/userfiles/userfiles/macros/
KoF0.70/userfiles/userfiles/mail/
KoF0.70/userfiles/userfiles/profiles/
KoF0.70/userfiles/userfiles/reminders/
KoF0.70/userfiles/userfiles/rooms/
KoF0.70/userfiles/userfiles/xgcoms/
KoF0.70/userfiles/xgcoms/
/*****************************************************************************
                    Header file for Amnuts version 2.2.0
      Copyright (C) Andrew Collington - Last update: 20th September, 1999
               amnuts@iname.com  |  http://www.talker.com/amnuts/
 *****************************************************************************/
  /**************************************************************************
 *                KoF 0.70.b is done by Lauri Tamm                           *
 *                ( larts@hot.ee or lauri@erm.ee )                           *
   **************************************************************************/


/* version number - you can add and check against your own version number
   but the Amnuts and NUTS must stay the same as listed below
   */
#define KOFVERS   "0.70.b"
#define AMNUTSVER "2.2.0"
#define NUTSVER "3.3.3"
#define USERVER "0.2"

/* general directories */
#define DATAFILES "datafiles"
#define HELPFILES "helpfiles"
#define HELPFILES2 "helpfiles2"
#define MAILSPOOL "mailspool"
#define MISCFILES "miscfiles"
#define NEWSFILES "newsfiles"
#define UUEKE     "uueke"
#define SOCFILES  "socfiles"
#define MOTDFILES "motds"
#define DUMPFILES "dumpfiles"
#define TEXTFILES "textfiles"
#define ADMINFILES "adminfiles"
#define LOGFILES "logfiles"

/* user directories */
#define USERFILES "userfiles"
#define USERMAILS "mail"
#define USERPROFILES "profiles"
#define USERFRIENDS "friends"
#define USERHISTORYS "historys"
#define USERCOMMANDS "xgcoms"
#define USERMACROS "macros"
#define USERROOMS "rooms"
#define USERREMINDERS "reminders"

/* files */
#define CONFIGFILE "config"
#define NEWSLIST "newslist"
#define SOCIALS  "socials"
#define SITEBAN "siteban"
#define USERBAN "userban"
#define NEWBAN "newban"
#define SUGBOARD "suggestions"
#define RULESFILE "rules"
#define WIZRULESFILE "wizrules"
#define HANGDICT "hangman_words"
#define SHOWFILES "showfiles"
#define NEWHELP   "newhelp"
/* system logs */
#define LAST_CMD   "last_command"
#define MAINSYSLOG "syslog"
#define NETSYSLOG  "netlog"
#define REQSYSLOG  "reqlog"
#define SYSLOG 0
#define REQLOG 1
#define NETLOG 2

/* general defines */
#define OUT_BUFF_SIZE 1000
#define MAX_WORDS 10
#define WORD_LEN 80
#define ARR_SIZE 1000
#define MAX_LINES 15
#define REVIEW_LINES 20
#define REVTELL_LINES 25
#define REVIEW_LEN 400
#define BUFSIZE 1000
#define ROOM_NAME_LEN 20
#define ROOM_LABEL_LEN 5
#define SBOFF 0
#define SBMIN 1
#define SBMAX 2
#define LASTLOGON_NUM 5
#define LOGIN_FLOOD_CNT 20

/* user defines */
#define USER_NAME_LEN 12
#define USER_DESC_LEN 35
#define AFK_MESG_LEN 60
#define PHRASE_LEN 40
#define PASS_LEN 20 /* only the 1st 8 chars will be used by crypt() though */
#define ROOM_DESC_LEN (MAX_LINES*80)+MAX_LINES /* MAX_LINES lines of 80 chars each + MAX_LINES nl */
#define TOPIC_LEN 60
#define NEUTER 0
#define MALE   1
#define FEMALE 2
#define ESTONIAN 1
#define ENGLISH  0
#define NEWBIE_EXPIRES 0 /* days */
#define USER_EXPIRES   40 /* days */
#define SCREEN_WRAP 80 /* how many characters to wrap to */
#define MAX_COPIES 6 /* of smail */
#define MACRO_LEN 65
#define MAX_FRIENDS 10
#define MAX_GROUP 20   /* future feature, to talk some group people without saving them */
#define MAX_IGNORES 10 /* number of users you can ignore */
#define MAX_XCOMS 10
#define MAX_GCOMS 10
#define MAX_PAGES 1000 /* should be enough! */
#define MAX_REMINDERS 30
#define REMINDER_LEN  70

/* rooms */
#define MAX_LINKS 20
#define PUBLIC 0
#define PRIVATE 1
#define FIXED 2
#define FIXED_PUBLIC 2
#define FIXED_PRIVATE 3
#define PERSONAL_UNLOCKED 4
#define PERSONAL_LOCKED 5

/* levels */
#define JAILED 0
#define GUEST  1
#define USER   2
#define WIZ    3
#define ARCH   4
#define CHAOS  5

/* user and clone types */
#define USER_TYPE 0
#define CLONE_TYPE 1
#define REMOTE_TYPE 2
#define CLONE_HEAR_NOTHING 0
#define CLONE_HEAR_SWEARS 1
#define CLONE_HEAR_ALL 2

/* logon prompt stuff */
#define LOGIN_ATTEMPTS 3
#define LOGIN_NAME 1
#define LOGIN_PASSWD 2
#define LOGIN_CONFIRM 3
#define LOGIN_PROMPT 4

/* some macros that are used in the code */
/* these are for grammer */
#define PLTEXT_S(n) &"s"[(1==(n))]
#define PLTEXT_ES(n) &"es"[(1==(n))<<1]
#define PLTEXT_IS(n) ((1==(n))?"is":"are")
#define PLTEXT_WAS(n) ((1==(n))?"was":"were")
#define SIZEOF(table) (sizeof(table)/sizeof(table[0]))
/* these are for bit manipulation */
#define BIT_BOOL(x) (!(!(x)))
#define BIT_SET(arg,pos) ((arg) | (1L << (pos)))
#define BIT_CLR(arg,pos) ((arg) & ~(1L << (pos)))
#define BIT_TEST(arg,pos) BIT_BOOL((arg) & (1L << (pos)))
#define BIT_FLIP(arg,pos) ((arg) ^ (1L << (pos)))


/* attempt to stop freezing time.  Thanks to Arny ('Paris' code creator)
   and Cygnus ('Ncohafmuta' code creator) for this */
#if !defined __GLIBC__ || __GLIBC__ < 2
#define SIGNAL(x,y) signal(x,y)
#else
#define SIGNAL(x,y) sysv_signal(x,y)
#endif


/* user variables - some are saved in the user file, and some are not */
struct user_struct {
  char name[USER_NAME_LEN+1],desc[USER_DESC_LEN+1],pass[PASS_LEN+6];
  char in_phrase[PHRASE_LEN+1],out_phrase[PHRASE_LEN+1];
  char buff[BUFSIZE],site[81],ipsite[81],last_site[81],page_file[81];
  char mail_to[WORD_LEN+1],revbuff[REVTELL_LINES][REVIEW_LEN+2];
  char afk_mesg[AFK_MESG_LEN+1],inpstr_old[REVIEW_LEN+1];
  char tname[80],tsite[80],tport[5],logout_room[ROOM_NAME_LEN+1],version[10];
  char copyto[MAX_COPIES][USER_NAME_LEN+1],invite_by[USER_NAME_LEN+1],date[80];
  char email[81],homepage[81],ignoreuser[MAX_IGNORES][USER_NAME_LEN+1],recap[USER_NAME_LEN+USER_NAME_LEN*3];
  char bw_recap[USER_NAME_LEN+1],call[USER_NAME_LEN+1],macros[10][MACRO_LEN],friend[MAX_FRIENDS][USER_NAME_LEN+1];
  char verify_code[80],afkbuff[REVTELL_LINES][REVIEW_LEN+2],editbuff[REVTELL_LINES][REVIEW_LEN+2];
  char samesite_check_store[ARR_SIZE],hang_word[WORD_LEN+1],hang_word_show[WORD_LEN+1],hang_guess[WORD_LEN+1];
  char *malloc_start,*malloc_end;
  int type,login,attempts,vis,ignall,prompt,command_mode,charmode_echo;
  int gender,language,hideemail,edit_line,warned,accreq,ignall_store,igntells,real_level;
  int afk,clone_hear,colour,ignshouts,unarrest,arrestby,pager,expire,lroom,monitor;
  int show_rdesc,wrap,alert,mail_verified,autofwd,editing,show_pass,pagecnt,pages[MAX_PAGES];
  int ignlogons,ignwiz,ignbeeps,hang_stage,samesite_all_store;
  int port,site_port,socket,buffpos,filepos,remote_com,charcnt,misc_op,last_login_len;
  int edit_op,revline,level,wipe_from,wipe_to,logons,cmd_type,user_page_pos,user_page_lev;
  int age,misses,hits,kills,deaths,bullets,hps,afkline,editline,login_prompt;
  int lmail_lev,hwrap_lev,hwrap_id,hwrap_same,hwrap_func,gcoms[MAX_GCOMS],xcoms[MAX_XCOMS];
  struct room_struct *room,*invite_room,*wrap_room;
  struct user_struct *prev,*next,*owner;
  struct {
    int day,month,year,alert; char msg[REMINDER_LEN];
    } reminder[MAX_REMINDERS],temp_remind;
  time_t last_input,last_login,total_login,read_mail,t_expire;
  #ifdef NETLINKS
    struct netlink_struct *netlink,*pot_netlink;
  #endif
  };
typedef struct user_struct *UR_OBJECT;
UR_OBJECT user_first,user_last;

/* structure to see who last logged on */
 struct {
  char name[USER_NAME_LEN+1],time[80];
  short int on;
  } 
last_login_info[LASTLOGON_NUM+1];

/* room informaytion structure */
struct room_struct {
  char name[ROOM_NAME_LEN+1],label[ROOM_LABEL_LEN+1],desc[ROOM_DESC_LEN+1];
  char topic[TOPIC_LEN+1],revbuff[REVIEW_LINES][REVIEW_LEN+2],map[ROOM_NAME_LEN+1];
  int access; /* public , private etc */
  int revline; /* line number for review */
  int mesg_cnt;
  char link_label[MAX_LINKS][ROOM_LABEL_LEN+1]; /* temp store for parse */
  struct room_struct *link[MAX_LINKS];
  struct room_struct *next,*prev;
#ifdef NETLINKS
  int inlink; /* 1 if room accepts incoming net links */
  char netlink_name[SERV_NAME_LEN+1]; /* temp store for config parse */
  struct netlink_struct *netlink; /* for net links, 1 per room */
#endif
  };
typedef struct room_struct *RM_OBJECT;
RM_OBJECT room_first,room_last;

#ifdef NETLINKS
/* Structure for net links, ie server initiates them */
struct netlink_struct {
  char service[SERV_NAME_LEN+1];
  char site[SITE_NAME_LEN+1];
  char verification[VERIFY_LEN+1];
  char buffer[ARR_SIZE*2];
  char mail_to[WORD_LEN+1];
  char mail_from[WORD_LEN+1];
  FILE *mailfile;
  time_t last_recvd; 
  int port,socket,type,connected;
  int stage,lastcom,allow,warned,keepalive_cnt;
  int ver_major,ver_minor,ver_patch;
  struct user_struct *mesg_user;
  struct room_struct *connect_room;
  struct netlink_struct *prev,*next;
};
typedef struct netlink_struct *NL_OBJECT;
NL_OBJECT nl_first,nl_last;
#endif

/* main user list structure */
struct user_dir_struct {
  char name[USER_NAME_LEN+1],date[80];
  short int level;
  struct user_dir_struct *next,*prev;
  };
struct user_dir_struct *first_dir_entry,*last_dir_entry;

/* main list of wizzes */
struct wiz_list_struct {
  char name[USER_NAME_LEN+1];
  short int level;
  struct wiz_list_struct *next,*prev;
  };
struct wiz_list_struct *first_wiz_entry,*last_wiz_entry;

/* command list */
struct command_struct {
  char name[15],alias[5]; /* 15 and 5 characters should be long enough */
  short int id,min_lev,function;
  int count;
  struct command_struct *next,*prev;
  };
struct command_struct *first_command,*last_command;
char cmd_history[16][128];

/* system structure */
struct system_struct {
  int heartbeat,keepalive_interval,ignore_sigterm,mesg_life,mesg_check_hour,mesg_check_min;
  int net_idle_time,login_idle_time,user_idle_time,time_out_maxlevel,time_out_afks,crash_action;
  int num_of_users,num_of_logins,logons_old,logons_new,auto_purge,purge_count,purge_skip,users_purged;
  int user_count,max_users,max_clones,min_private_users,colour_def,charecho_def,prompt_def;
  int wizport_level,minlogin_level,gatecrash_level,ignore_mp_level,rem_user_maxlevel,rem_user_deflevel;
  int password_echo,auto_promote,ban_swearing,personal_rooms,startup_room_parse,auto_connect;
  int allow_recaps,suggestion_count,random_motds,motd1_cnt,motd2_cnt,forwarding,sbuffline;
  int resolve_ip,rs_countdown,level_count[CHAOS+1],last_cmd_cnt,flood_protect;
  unsigned short logging;
  unsigned int pid;
  char sysname[64],sysmachine[64],sysrelease[64],sysversion[64],sysnodename[256]; /*,shoutbuff[REVIEW_LINES][REVIEW_LEN+2]; */
  time_t boot_time,rs_announce,rs_which,purge_date;
  UR_OBJECT rs_user;
  };
typedef struct system_struct *SYS_OBJECT;
SYS_OBJECT amsys;


/* levels used on the talker */
struct {
  char *name;
  char *alias;
  } user_level[]={
    { "JAILED", " " },
    { "GUEST",  " " },
    { "USER",   " " },
    { "WIZ",    " " },
    { "ARCH",   " " },
    { "CHAOS",  " " }
  };
#define NUM_LEVELS SIZEOF(user_level)


/* default rooms */
char *default_jail="jail";
char *default_warp="reception";
char *default_shoot="directors";

/* The rooms listed here are just examples of what can be added
   You may add more or remove as many as you like, but you MUST
   keep the stopping clause in */
struct { 
  char *name; int level; 
  } priv_room[]={
    { "wizroom",WIZ }, /* a room for wizzes+ only */
    { "andys_computer",CHAOS }, /* only top people can get in this place! */
    { "*",0 } /* stopping clause */
    };

/* you can set a standard room desc for those people who are creating a new
   personal room */
char *default_personal_room_desc=
"The walls are stark and the floors are bare.  Either the owner is new\n\
or just plain lazy.  Perhaps they just don't know how to use the .mypaint\n\
command yet?\n";


/* colour code values */
struct {
  char *esc_code;
  char *txt_code;
  } colour_codes[]={
    /* Standard stuff */
    { "\033[0m", "RS" }, /* reset */
    { "\033[1m", "OL" }, /* bold */
    { "\033[4m", "UL" }, /* underline */
    { "\033[5m", "LI" }, /* blink */
    { "\033[7m", "RV" }, /* reverse */
    /* Foreground colour */
    { "\033[30m", "FK" }, /* black */
    { "\033[31m", "FR" }, /* red */
    { "\033[32m", "FG" }, /* green */
    { "\033[33m", "FY" }, /* yellow */
    { "\033[34m", "FB" }, /* blue */
    { "\033[35m", "FM" }, /* magenta */
    { "\033[36m", "FT" }, /* turquiose */
    { "\033[37m", "FW" }, /* white */
    /* Background colour */
    { "\033[40m", "BK" }, /* black */
    { "\033[41m", "BR" }, /* red */
    { "\033[42m", "BG" }, /* green */
    { "\033[43m", "BY" }, /* yellow */
    { "\033[44m", "BB" }, /* blue */
    { "\033[45m", "BM" }, /* magenta */
    { "\033[46m", "BT" }, /* turquiose */
    { "\033[47m", "BW" }, /* white */
  };
#define NUM_COLS SIZEOF(colour_codes)


/* some general arrays being defined */
char *month[12]={
  "January","February","March","April","May","June",
  "July","August","September","October","November","December"
  };

char *day[7]={
  "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
  };
char *noyes1[]={ " NO","YES" };
char *noyes2[]={ "NO ","YES" };
char *noyes3[]={ "-","+" };   
char *offon[]={ "OFF","ON " };
char *minmax[]={"OFF","MIN","MAX"};
char *sex[]={"Neuter","Male","Female"};
char *language[]={"English","Estonian"};


/* random kill messages */
struct {
  char *victim_msg;
  char *room_msg;
  } kill_mesgs[]={
    {"You are killed\n","%s is killed\n"},
    {"You have been totally splatted\n","A hammer splats %s\n"},
    {"The Hedgehog Of Doom runs over you with a car.\n","The Hedgehog Of Doom runs over %s with a car.\n"},
    {"The Inquisitor deletes the worthless, prunes away the wastrels... ie, YOU!","The Inquisitor prunes away %s.\n"}
  };
#define MAX_KILL_MESGS SIZEOF(kill_mesgs)


/* other strings used on the talker */
char *syserror="Sorry, a system error has occured";
char *nosuchroom="There is no such room.\n";
char *nosuchuser="There is no such user.\n";
char *notloggedon="There is no one of that name logged on.\n";
char *invisenter="A presence enters the room...\n";
char *invisleave="A presence leaves the room...\n";
char *invisname="A presence";
char *talker_name="Kingdom of Future";
char *crypt_salt="NU";


/* you can change this for whatever sig you want - of just "" if you don't want
   to have a sig file attached at the end of emails */
char *talker_signature=
"+--------------------------------------------------------------------------+\n\
|  This message has been smailed to you on The Kingdom of Future, and this |\n\
|  is your auto-forward.  Please do not reply directly to this email.      |\n\
|                                                                          |\n\
|               KoF - A talker running at www.local.ee 2222                |\n\
|   email 'larts@www.profindex.com' if you have any questions/comments     |\n\
+--------------------------------------------------------------------------+\n";


/* swear words array.  These must all be lowercase.  * is the stopping clause and
   must remain in the array even if you have no words listed.
   */
char *swear_words[]={
  "fuck","cunt","cock","bastard","dyke","fag","pussy","bitch","*"
  };

/* This is what replaces any swear words in a string if the swearban is set to MIN. */
char *swear_censor="smeg"; /* alright so I'm a Red Dwarf fan! */
char *noswearing="Swearing is not allowed here.\n";


/* Other global variables */
char text[ARR_SIZE*2],vtext[ARR_SIZE*2];
char word[MAX_WORDS][WORD_LEN+1];
char wrd[8][81];
char progname[40],confile[40];
jmp_buf jmpvar;
#ifdef NETLINKS
  char verification[SERV_NAME_LEN+1];
  int listen_sock[3],port[3],port_total=3;
#else 
  int listen_sock[2],port[2],port_total=2;
#endif
int tyear,tmonth,tday,tmday,twday,thour,tmin,tsec;
int destructed,force_listen,no_prompt,logon_flag;
int config_line,word_count;


/* Letter array map - for greet() */
/* int biglet[26][5][5] = {
  {{0,1,1,1,0},{1,0,0,0,1},{1,1,1,1,1},{1,0,0,0,1},{1,0,0,0,1}},
  {{1,1,1,1,0},{1,0,0,0,1},{1,1,1,1,0},{1,0,0,0,1},{1,1,1,1,0}},
  {{0,1,1,1,1},{1,0,0,0,0},{1,0,0,0,0},{1,0,0,0,0},{0,1,1,1,1}},
  {{1,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,0}},
  {{1,1,1,1,1},{1,0,0,0,0},{1,1,1,1,0},{1,0,0,0,0},{1,1,1,1,1}},
  {{1,1,1,1,1},{1,0,0,0,0},{1,1,1,1,0},{1,0,0,0,0},{1,0,0,0,0}},
  {{0,1,1,1,0},{1,0,0,0,0},{1,0,1,1,0},{1,0,0,0,1},{0,1,1,1,0}},
  {{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,1},{1,0,0,0,1},{1,0,0,0,1}},
  {{0,1,1,1,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{0,1,1,1,0}},
  {{0,0,0,0,1},{0,0,0,0,1},{0,0,0,0,1},{1,0,0,0,1},{0,1,1,1,0}},
  {{1,0,0,0,1},{1,0,0,1,0},{1,0,1,0,0},{1,0,0,1,0},{1,0,0,0,1}},
  {{1,0,0,0,0},{1,0,0,0,0},{1,0,0,0,0},{1,0,0,0,0},{1,1,1,1,1}},
  {{1,0,0,0,1},{1,1,0,1,1},{1,0,1,0,1},{1,0,0,0,1},{1,0,0,0,1}},
  {{1,0,0,0,1},{1,1,0,0,1},{1,0,1,0,1},{1,0,0,1,1},{1,0,0,0,1}},
  {{0,1,1,1,0},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{0,1,1,1,0}},
  {{1,1,1,1,0},{1,0,0,0,1},{1,1,1,1,0},{1,0,0,0,0},{1,0,0,0,0}},
  {{0,1,1,1,0},{1,0,0,0,1},{1,0,1,0,1},{1,0,0,1,1},{0,1,1,1,0}},
  {{1,1,1,1,0},{1,0,0,0,1},{1,1,1,1,0},{1,0,0,1,0},{1,0,0,0,1}},
  {{0,1,1,1,1},{1,0,0,0,0},{0,1,1,1,0},{0,0,0,0,1},{1,1,1,1,0}},
  {{1,1,1,1,1},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0}},
  {{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,1}},
  {{1,0,0,0,1},{1,0,0,0,1},{0,1,0,1,0},{0,1,0,1,0},{0,0,1,0,0}},
  {{1,0,0,0,1},{1,0,0,0,1},{1,0,1,0,1},{1,1,0,1,1},{1,0,0,0,1}},
  {{1,0,0,0,1},{0,1,0,1,0},{0,0,1,0,0},{0,1,0,1,0},{1,0,0,0,1}},
  {{1,0,0,0,1},{0,1,0,1,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0}},
  {{1,1,1,1,1},{0,0,0,1,0},{0,0,1,0,0},{0,1,0,0,0},{1,1,1,1,1}}
  };
*/
/* Symbol array map - for greet() */
/* int bigsym[32][5][5] = {
  {{0,0,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{0,0,0,0,0},{0,0,1,0,0}},
  {{0,1,0,1,0},{0,1,0,1,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0}},
  {{0,1,0,1,0},{1,1,1,1,1},{0,1,0,1,0},{1,1,1,1,1},{0,1,0,1,0}},
  {{0,1,1,1,1},{1,0,1,0,0},{0,1,1,1,0},{0,0,1,0,1},{1,1,1,1,0}},
  {{1,1,0,0,1},{1,1,0,1,0},{0,0,1,0,0},{0,1,0,1,1},{1,0,0,1,1}},
  {{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0}},
  {{0,0,1,0,0},{0,0,1,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0}},
  {{0,0,1,1,0},{0,1,0,0,0},{0,1,0,0,0},{0,1,0,0,0},{0,0,1,1,0}},
  {{0,1,1,0,0},{0,0,0,1,0},{0,0,0,1,0},{0,0,0,1,0},{0,1,1,0,0}},
  {{1,0,1,0,1},{0,1,1,1,0},{1,1,1,1,1},{0,1,1,1,0},{1,0,1,0,1}},
  {{0,0,1,0,0},{0,0,1,0,0},{1,1,1,1,1},{0,0,1,0,0},{0,0,1,0,0}},
  {{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0}},
  {{0,0,0,0,0},{0,0,0,0,0},{1,1,1,1,1},{0,0,0,0,0},{0,0,0,0,0}},
  {{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{1,1,0,0,0},{1,1,0,0,0}},
  {{0,0,0,0,1},{0,0,0,1,0},{0,0,1,0,0},{0,1,0,0,0},{1,0,0,0,0}},
  {{0,1,1,1,0},{1,0,0,1,1},{1,0,1,0,1},{1,1,0,0,1},{0,1,1,1,0}},
  {{0,0,1,0,0},{0,1,1,0,0},{0,0,1,0,0},{0,0,1,0,0},{0,1,1,1,0}},
  {{1,1,1,1,0},{0,0,0,0,1},{0,1,1,1,0},{1,0,0,0,0},{1,1,1,1,1}},
  {{1,1,1,1,0},{0,0,0,0,1},{0,1,1,1,0},{0,0,0,0,1},{1,1,1,1,0}},
  {{0,0,1,1,0},{0,1,0,0,0},{1,0,0,1,0},{1,1,1,1,1},{0,0,0,1,0}},
  {{1,1,1,1,1},{1,0,0,0,0},{1,1,1,1,0},{0,0,0,0,1},{1,1,1,1,0}},
  {{0,1,1,1,0},{1,0,0,0,0},{1,1,1,1,0},{1,0,0,0,1},{0,1,1,1,0}},
  {{1,1,1,1,1},{0,0,0,0,1},{0,0,0,1,0},{0,0,1,0,0},{0,1,0,0,0}},
  {{0,1,1,1,0},{1,0,0,0,1},{0,1,1,1,0},{1,0,0,0,1},{0,1,1,1,0}},
  {{1,1,1,1,1},{1,0,0,0,1},{1,1,1,1,1},{0,0,0,0,1},{0,0,0,0,1}},
  {{0,0,0,0,0},{0,0,1,0,0},{0,0,0,0,0},{0,0,1,0,0},{0,0,0,0,0}},
  {{0,0,0,0,0},{0,0,1,0,0},{0,0,0,0,0},{0,0,1,0,0},{0,1,0,0,0}},
  {{0,0,0,1,0},{0,0,1,0,0},{0,1,0,0,0},{0,0,1,0,0},{0,0,0,1,0}},
  {{0,0,0,0,0},{1,1,1,1,1},{0,0,0,0,0},{1,1,1,1,1},{0,0,0,0,0}},
  {{0,1,0,0,0},{0,0,1,0,0},{0,0,0,1,0},{0,0,1,0,0},{0,1,0,0,0}},
  {{0,1,1,1,1},{0,0,0,0,1},{0,0,1,1,1},{0,0,0,0,0},{0,0,1,0,0}},
  {{0,1,0,0,0},{1,0,1,1,1},{1,0,1,0,1},{1,0,1,1,1},{0,1,1,1,0}}
  };
*/

/* hangman picture for the hangman game */
char *hanged[8]={
  "~FY~OL+~RS~FY---~OL+  \n~FY|      \n~FY|~RS           ~OLWord:~RS %s\n~FY|~RS           ~OLLetters guessed:~RS %s\n~FY|~RS      \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS           ~OLWord:~RS %s\n~FY|~RS           ~OLLetters guessed:~RS %s\n~FY|~RS      \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS   O       ~OLWord:~RS %s\n~FY|~RS           ~OLLetters guessed:~RS %s\n~FY|~RS      \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS   O       ~OLWord:~RS %s\n~FY|~RS   |       ~OLLetters guessed:~RS %s\n~FY|~RS      \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS   O       ~OLWord:~RS %s\n~FY|~RS  /|       ~OLLetters guessed:~RS %s\n~FY|~RS      \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS   O       ~OLWord:~RS %s\n~FY|~RS  /|\\      ~OLLetters guessed:~RS %s\n~FY|~RS      \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS   O       ~OLWord:~RS %s\n~FY|~RS  /|\\      ~OLLetters guessed:~RS %s\n~FY|~RS  /   \n~FY|______\n",
  "~FY~OL+~RS~FY---~OL+  \n~FY|   |  \n~FY|~RS   O       ~OLWord:~RS %s\n~FY|~RS  /|\\      ~OLLetters guessed:~RS %s\n~FY|~RS  / \\ \n~FY|______\n"
  };



 /*****************************************************************************
            Calendar code taken from Way Out West version 4.0.0
                      Copyright (C) Andrew Collington

               based upon scalar date routines by Ray Gardner   
 *****************************************************************************/


/* Define ISO to be 1 for ISO (Mon-Sun) calendars
   ISO defines the first week with 4 or more days in it to be week #1.
   */
#ifndef ISO
 #define ISO 0
#endif

#if (ISO!=0 && ISO!=1)
 #error ISO must be set to either 0 or 1
#endif

int cal_days[12]={31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
char *cal_daynames[8]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"};