summaryrefslogtreecommitdiffstats
path: root/robots/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'robots/move.c')
-rw-r--r--robots/move.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/robots/move.c b/robots/move.c
index c146eb3d..c78bcb53 100644
--- a/robots/move.c
+++ b/robots/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.5 1997/05/23 23:40:19 jtc Exp $ */
+/* $NetBSD: move.c,v 1.6 1997/10/12 14:09:59 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -33,16 +33,15 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: move.c,v 1.5 1997/05/23 23:40:19 jtc Exp $";
+__RCSID("$NetBSD: move.c,v 1.6 1997/10/12 14:09:59 lukem Exp $");
#endif
#endif /* not lint */
-#include <sys/ttydefaults.h>
-#include <ctype.h>
#include "robots.h"
# define ESC '\033'
@@ -51,11 +50,10 @@ static char rcsid[] = "$NetBSD: move.c,v 1.5 1997/05/23 23:40:19 jtc Exp $";
* get_move:
* Get and execute a move from the player
*/
+void
get_move()
{
- register int c;
- register int y, x, lastmove;
- static COORD newpos;
+ int c;
if (Waiting)
return;
@@ -156,7 +154,7 @@ over:
case 'q':
case 'Q':
if (query("Really quit?"))
- quit();
+ quit(0);
refresh();
break;
case 'w':
@@ -198,9 +196,10 @@ ret:
* Must I teleport; i.e., is there anywhere I can move without
* being eaten?
*/
+bool
must_telep()
{
- register int x, y;
+ int x, y;
static COORD newpos;
#ifdef FANCY
@@ -229,8 +228,9 @@ must_telep()
* do_move:
* Execute a move
*/
+bool
do_move(dy, dx)
-int dy, dx;
+ int dy, dx;
{
static COORD newpos;
@@ -265,10 +265,11 @@ int dy, dx;
* eaten:
* Player would get eaten at this place
*/
+bool
eaten(pos)
-register COORD *pos;
+ COORD *pos;
{
- register int x, y;
+ int x, y;
for (y = pos->y - 1; y <= pos->y + 1; y++) {
if (y <= 0 || y >= Y_FIELDSIZE)
@@ -287,6 +288,7 @@ register COORD *pos;
* reset_count:
* Reset the count variables
*/
+void
reset_count()
{
Count = 0;
@@ -299,6 +301,7 @@ reset_count()
* jumping:
* See if we are jumping, i.e., we should not refresh.
*/
+bool
jumping()
{
return (Jump && (Count || Running || Waiting));