133111Sbostic /* 2*34781Sbostic * Copyright (c) 1983 Regents of the University of California. 333111Sbostic * All rights reserved. 433111Sbostic * 533111Sbostic * Redistribution and use in source and binary forms are permitted 6*34781Sbostic * provided that the above copyright notice and this paragraph are 7*34781Sbostic * duplicated in all such forms and that any documentation, 8*34781Sbostic * advertising materials, and other materials related to such 9*34781Sbostic * distribution and use acknowledge that the software was developed 10*34781Sbostic * by the University of California, Berkeley. The name of the 11*34781Sbostic * University may not be used to endorse or promote products derived 12*34781Sbostic * from this software without specific prior written permission. 13*34781Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14*34781Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15*34781Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 1633111Sbostic */ 1733111Sbostic 1833111Sbostic #ifndef lint 19*34781Sbostic static char sccsid[] = "@(#)setup.c 5.2 (Berkeley) 06/18/88"; 2033111Sbostic #endif /* not lint */ 2133111Sbostic 2233111Sbostic # include "hangman.h" 2333111Sbostic 2433111Sbostic /* 2533111Sbostic * setup: 2633111Sbostic * Set up the strings on the screen. 2733111Sbostic */ 2833111Sbostic setup() 2933111Sbostic { 3033111Sbostic register char **sp; 3133111Sbostic static struct stat sbuf; 3233111Sbostic 3333111Sbostic noecho(); 3433111Sbostic crmode(); 3533111Sbostic 3633111Sbostic mvaddstr(PROMPTY, PROMPTX, "Guess:"); 3733111Sbostic mvaddstr(GUESSY, GUESSX, "Guessed:"); 3833111Sbostic mvaddstr(NUMBERY, NUMBERX, "Word #:"); 3933111Sbostic mvaddstr(AVGY, AVGX, "Current Average:"); 4033111Sbostic mvaddstr(AVGY + 1, AVGX, "Overall Average:"); 4133111Sbostic mvaddstr(KNOWNY, KNOWNX, "Word: "); 4233111Sbostic 4333111Sbostic for (sp = Noose_pict; *sp != NULL; sp++) { 4433111Sbostic move(sp - Noose_pict, 0); 4533111Sbostic addstr(*sp); 4633111Sbostic } 4733111Sbostic 4833111Sbostic srand(time(NULL) + getpid()); 4933111Sbostic if ((Dict = fopen(DICT, "r")) == NULL) { 5033111Sbostic perror(DICT); 5133111Sbostic endwin(); 5233111Sbostic exit(1); 5333111Sbostic } 5433111Sbostic fstat(fileno(Dict), &sbuf); 5533111Sbostic Dict_size = sbuf.st_size; 5633111Sbostic } 57