new copyright notice
[unix-history] / usr / src / games / snake / snake / move.c
index d0ee360..0c804a8 100644 (file)
@@ -2,16 +2,11 @@
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1980 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of California at Berkeley. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)move.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)move.c     5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 /*************************************************************************
 #endif /* not lint */
 
 /*************************************************************************
@@ -59,10 +54,8 @@ static char sccsid[] = "@(#)move.c   5.4 (Berkeley) %G%";
  *             getcap()        initializes strings for later calls.
  *             cap(string)     outputs the string designated in the termcap
  *                                     data base. (Should not move the cursor.)
  *             getcap()        initializes strings for later calls.
  *             cap(string)     outputs the string designated in the termcap
  *                                     data base. (Should not move the cursor.)
- *             done(int)       returns the terminal to intial state.  If int
- *                                     is not 0, it exits.
+ *             done()          returns the terminal to intial state and exits.
  *
  *
- *             same(&p1,&p2)   returns 1 if p1 and p2 are the same point.
  *             point(&p,x,y)   return point set to x,y.
  *
  *             baudrate(x)     returns the baudrate of the terminal.
  *             point(&p,x,y)   return point set to x,y.
  *
  *             baudrate(x)     returns the baudrate of the terminal.
@@ -509,13 +502,6 @@ raw()
 #endif
 }
 
 #endif
 }
 
-same(sp1,sp2)
-struct point *sp1, *sp2;
-{
-       if ((sp1->line == sp2->line) && (sp1->col == sp2->col))return(1);
-       return(0);
-}
-
 struct point *point(ps,x,y)
 struct point *ps;
 int x,y;
 struct point *point(ps,x,y)
 struct point *ps;
 int x,y;
@@ -554,8 +540,10 @@ getcap()
 
        LINES = tgetnum("li");
        COLUMNS = tgetnum("co");
 
        LINES = tgetnum("li");
        COLUMNS = tgetnum("co");
-       lcnt = LINES;
-       ccnt = COLUMNS - 1;
+       if (!lcnt)
+               lcnt = LINES - 2;
+       if (!ccnt)
+               ccnt = COLUMNS - 3;
 
        AM = tgetflag("am");
        BW = tgetflag("bw");
 
        AM = tgetflag("am");
        BW = tgetflag("bw");