summaryrefslogtreecommitdiffstats
path: root/worm
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1999-08-10 21:52:43 +0000
committerhubertf <hubertf@NetBSD.org>1999-08-10 21:52:43 +0000
commitb3d8c476cf20195b9b5ed4842b95c4df54201718 (patch)
tree670f15bc3c54dfcf4167d8c51a62a8164fcf2ab3 /worm
parent3da7ebf6e412f879185cd16af8206fab301b24d5 (diff)
downloadbsdgames-darwin-b3d8c476cf20195b9b5ed4842b95c4df54201718.tar.gz
bsdgames-darwin-b3d8c476cf20195b9b5ed4842b95c4df54201718.tar.zst
bsdgames-darwin-b3d8c476cf20195b9b5ed4842b95c4df54201718.zip
Leave ^Z-handling to the system (curses? no idea, at least it works :-),
and don't wait for two seconds when game is over.
Diffstat (limited to 'worm')
-rw-r--r--worm/worm.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/worm/worm.c b/worm/worm.c
index 618436c5..20a82dc7 100644
--- a/worm/worm.c
+++ b/worm/worm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: worm.c,v 1.11 1999/08/08 03:08:08 hubertf Exp $ */
+/* $NetBSD: worm.c,v 1.12 1999/08/10 21:52:43 hubertf Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)worm.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: worm.c,v 1.11 1999/08/08 03:08:08 hubertf Exp $");
+__RCSID("$NetBSD: worm.c,v 1.12 1999/08/10 21:52:43 hubertf Exp $");
#endif
#endif /* not lint */
@@ -92,7 +92,6 @@ void process __P((char));
void prize __P((void));
int rnd __P((int));
void setup __P((void));
-void suspend __P((int));
void wake __P((int));
int
@@ -111,7 +110,6 @@ main(argc, argv)
signal(SIGALRM, wake);
signal(SIGINT, leave);
signal(SIGQUIT, leave);
- signal(SIGTSTP, suspend); /* process control signal */
initscr();
crmode();
noecho();
@@ -250,7 +248,6 @@ process(ch)
case 'K': y--; running = RUNLEN/2; ch = tolower(ch); break;
case 'L': x++; running = RUNLEN; ch = tolower(ch); break;
case '\f': setup(); return;
- case CNTRL('Z'): suspend(0); return;
case CNTRL('C'): crash(); return;
case CNTRL('D'): crash(); return;
default: if (! running) alarm(1);
@@ -299,29 +296,10 @@ process(ch)
void
crash()
{
- sleep(2);
- clear();
- move(23, 0);
- refresh();
leave(0);
}
void
-suspend(dummy)
- int dummy;
-{
- move(LINES-1, 0);
- refresh();
- endwin();
- fflush(stdout);
- kill(getpid(), SIGTSTP);
- signal(SIGTSTP, suspend);
- crmode();
- noecho();
- setup();
-}
-
-void
setup()
{
clear();