1*61f28255Scgd /* 2*61f28255Scgd * Copyright (c) 1980 Regents of the University of California. 3*61f28255Scgd * All rights reserved. 4*61f28255Scgd * 5*61f28255Scgd * Redistribution and use in source and binary forms, with or without 6*61f28255Scgd * modification, are permitted provided that the following conditions 7*61f28255Scgd * are met: 8*61f28255Scgd * 1. Redistributions of source code must retain the above copyright 9*61f28255Scgd * notice, this list of conditions and the following disclaimer. 10*61f28255Scgd * 2. Redistributions in binary form must reproduce the above copyright 11*61f28255Scgd * notice, this list of conditions and the following disclaimer in the 12*61f28255Scgd * documentation and/or other materials provided with the distribution. 13*61f28255Scgd * 3. All advertising materials mentioning features or use of this software 14*61f28255Scgd * must display the following acknowledgement: 15*61f28255Scgd * This product includes software developed by the University of 16*61f28255Scgd * California, Berkeley and its contributors. 17*61f28255Scgd * 4. Neither the name of the University nor the names of its contributors 18*61f28255Scgd * may be used to endorse or promote products derived from this software 19*61f28255Scgd * without specific prior written permission. 20*61f28255Scgd * 21*61f28255Scgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22*61f28255Scgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23*61f28255Scgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24*61f28255Scgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25*61f28255Scgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26*61f28255Scgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27*61f28255Scgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28*61f28255Scgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29*61f28255Scgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30*61f28255Scgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31*61f28255Scgd * SUCH DAMAGE. 32*61f28255Scgd */ 33*61f28255Scgd 34*61f28255Scgd #ifndef lint 35*61f28255Scgd static char sccsid[] = "@(#)init.c 5.4 (Berkeley) 6/1/90"; 36*61f28255Scgd #endif /* not lint */ 37*61f28255Scgd 38*61f28255Scgd #include <sgtty.h> 39*61f28255Scgd 40*61f28255Scgd /* 41*61f28255Scgd * variable initialization. 42*61f28255Scgd */ 43*61f28255Scgd 44*61f28255Scgd /* name of executable object programs */ 45*61f28255Scgd char EXEC[] = "/usr/games/backgammon"; 46*61f28255Scgd char TEACH[] = "/usr/games/teachgammon"; 47*61f28255Scgd 48*61f28255Scgd int pnum = 2; /* color of player: 49*61f28255Scgd -1 = white 50*61f28255Scgd 1 = red 51*61f28255Scgd 0 = both 52*61f28255Scgd 2 = not yet init'ed */ 53*61f28255Scgd int acnt = 0; /* length of args */ 54*61f28255Scgd int aflag = 1; /* flag to ask for rules or instructions */ 55*61f28255Scgd int bflag = 0; /* flag for automatic board printing */ 56*61f28255Scgd int cflag = 0; /* case conversion flag */ 57*61f28255Scgd int hflag = 1; /* flag for cleaning screen */ 58*61f28255Scgd int mflag = 0; /* backgammon flag */ 59*61f28255Scgd int raflag = 0; /* 'roll again' flag for recovered game */ 60*61f28255Scgd int rflag = 0; /* recovered game flag */ 61*61f28255Scgd int tflag = 0; /* cursor addressing flag */ 62*61f28255Scgd int iroll = 0; /* special flag for inputting rolls */ 63*61f28255Scgd int rfl = 0; 64*61f28255Scgd 65*61f28255Scgd char *color[] = {"White","Red","white","red"}; 66