summaryrefslogtreecommitdiffstats
path: root/atc/update.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2015-06-25 05:33:02 +0000
committerdholland <dholland@NetBSD.org>2015-06-25 05:33:02 +0000
commit79cdfa8ea1b0bdba6889bfea03d2c4ab5987c675 (patch)
treecbdc37d27624e2960e4e7b059b4d46d28b1a0b5e /atc/update.c
parentcbfa4e0150e45039bfd90790eea6dca891ce4af6 (diff)
downloadbsdgames-darwin-79cdfa8ea1b0bdba6889bfea03d2c4ab5987c675.tar.gz
bsdgames-darwin-79cdfa8ea1b0bdba6889bfea03d2c4ab5987c675.zip
Move game logic out of the file with the curses code.
Diffstat (limited to 'atc/update.c')
-rw-r--r--atc/update.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/atc/update.c b/atc/update.c
index 052b1bf5..b736624a 100644
--- a/atc/update.c
+++ b/atc/update.c
@@ -1,4 +1,4 @@
-/* $NetBSD: update.c,v 1.26 2015/06/19 06:02:31 dholland Exp $ */
+/* $NetBSD: update.c,v 1.27 2015/06/25 05:33:02 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: update.c,v 1.26 2015/06/19 06:02:31 dholland Exp $");
+__RCSID("$NetBSD: update.c,v 1.27 2015/06/25 05:33:02 dholland Exp $");
#endif
#endif /* not lint */
@@ -232,6 +232,32 @@ update(int dummy __unused)
#endif
}
+void
+loser(const PLANE *p, const char *s)
+{
+ int c;
+#ifdef BSD
+ struct itimerval itv;
+#endif
+
+ /* disable timer */
+#ifdef BSD
+ itv.it_value.tv_sec = 0;
+ itv.it_value.tv_usec = 0;
+ (void)setitimer(ITIMER_REAL, &itv, NULL);
+#endif
+#ifdef SYSV
+ alarm(0);
+#endif
+
+ losermsg(p, s);
+ while ((c = getAChar()) != EOF && c != ' ')
+ ;
+ shutdown_gr();
+ (void)log_score(0);
+ exit(0);
+}
+
const char *
command(const PLANE *pp)
{