Index: spatial/intro.c
--- spatial/intro.c.orig
+++ spatial/intro.c
@@ -3,8 +3,13 @@
  notice is retained. */
 
 #include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
 #include <sys/time.h>
+#include <unistd.h>
 #include <X11/Xlib.h>
+#include <X11/Xutil.h>
 #include <X11/keysym.h>
 #include "spatial.h"
 
@@ -18,8 +23,6 @@ XDrawLine(dpy, win, gcwhite, x1, y1, x2, y2) 
 extern GC gcblack, gcwhite, gcinv, gccopy, gcline,
 gcfield, gccubes[];
 
-extern void intro_redraw(), redo_board_globals();
-
 void initintro()
 {
     intro_redraw();
@@ -60,7 +63,7 @@ void introloop()
 		intro_redraw();
 		break;
 	    case KeyPress:
-		XLookupString(&event, &key, 1, &ksym, NULL);
+		XLookupString(&event.xkey, &key, 1, &ksym, NULL);
 		/*printf("got '%s'\n", XKeysymToString(ksym));*/
 		switch (ksym) {
 		    case XK_q:
@@ -118,7 +121,7 @@ void intro_redraw()
     xputs(50, 220, "(C) Copyright 1991-3 Andrew Plotkin");
     xputs(50, 240, " (ap1i@andrew.cmu.edu)");
     if (score!=(-1)) {
-	sprintf(buf, "Your score: %d", score);
+	snprintf(buf, sizeof buf, "Your score: %ld", score);
 	xputs(50, 260, buf);
     }
 
