summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1999-04-20 23:01:14 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1999-04-20 23:01:14 +0000
commitb4cd185f95b2a5178319043c512cae1285cfbba5 (patch)
treeb6cbfcade82a1e6672c48e84dd72c0478a8f6c95
parent67b342787d34e5210f4e35291e075d0c3ec5d9ee (diff)
jsm28@cam.ac.uk: place cursor on player, not one over.
-rw-r--r--games/snake/snake.c10
-rw-r--r--games/worm/worm.c8
2 files changed, 12 insertions, 6 deletions
diff --git a/games/snake/snake.c b/games/snake/snake.c
index 767f3c51d5f..43a803a7a0c 100644
--- a/games/snake/snake.c
+++ b/games/snake/snake.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snake.c,v 1.1 1999/03/13 02:08:10 pjanzen Exp $ */
+/* $OpenBSD: snake.c,v 1.2 1999/04/20 23:01:12 pjanzen Exp $ */
/* $NetBSD: snake.c,v 1.8 1995/04/29 00:06:41 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-static char rcsid[] = "$OpenBSD: snake.c,v 1.1 1999/03/13 02:08:10 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: snake.c,v 1.2 1999/04/20 23:01:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -196,6 +196,7 @@ main(argc, argv)
setup();
mainloop();
/* NOT REACHED */
+ return(0);
}
/* Main command loop */
@@ -204,9 +205,12 @@ mainloop()
{
int j, k;
int c, match, lastc = 0;
+ struct point tmp;
for (;;) {
- move(&you);
+ tmp.col = you.col + 1;
+ tmp.line = you.line + 1; /* Highlight you, not left & above */
+ move(&tmp);
fflush(stdout);
if (((c = getchar() & 0177) <= '9') && (c >= '0')) {
ungetc(c, stdin);
diff --git a/games/worm/worm.c b/games/worm/worm.c
index ccf1b1c7f4e..ebd2cadacd9 100644
--- a/games/worm/worm.c
+++ b/games/worm/worm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: worm.c,v 1.7 1998/09/16 00:44:37 pjanzen Exp $ */
+/* $OpenBSD: worm.c,v 1.8 1999/04/20 23:01:13 pjanzen Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)worm.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: worm.c,v 1.7 1998/09/16 00:44:37 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: worm.c,v 1.8 1999/04/20 23:01:13 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -291,8 +291,10 @@ process(ch)
nh->x = x;
display(nh, HEAD);
head = nh;
- if (!(slow && running))
+ if (!(slow && running)) {
+ wmove(tv, head->y, head->x);
wrefresh(tv);
+ }
if (!running)
alarm(1);
}