-/* $NetBSD: assorted.c,v 1.10 2001/01/01 21:57:37 jwise Exp $ */
+/* $NetBSD: assorted.c,v 1.11 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)assorted.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: assorted.c,v 1.10 2001/01/01 21:57:37 jwise Exp $");
+__RCSID("$NetBSD: assorted.c,v 1.11 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include <unistd.h>
#include <err.h>
+void table(int, int, int, struct ship *, struct ship *, int);
+void Cleansnag(struct ship *, struct ship *, int, int);
static void strike (struct ship *, struct ship *);
void
-/* $NetBSD: dr_1.c,v 1.12 2001/01/01 21:57:37 jwise Exp $ */
+/* $NetBSD: dr_1.c,v 1.13 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_1.c,v 1.12 2001/01/01 21:57:37 jwise Exp $");
+__RCSID("$NetBSD: dr_1.c,v 1.13 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include "driver.h"
#include <stdlib.h>
+void unfoul(void);
+void boardcomp(void);
+static int fightitout(struct ship *, struct ship *, int);
+void resolve(void);
+void compcombat(void);
+int next(void);
+
void
unfoul(void)
{
}
}
-int
+static int
fightitout(struct ship *from, struct ship *to, int key)
{
struct ship *fromcap, *tocap;
-/* $NetBSD: dr_2.c,v 1.13 2001/01/01 21:57:37 jwise Exp $ */
+/* $NetBSD: dr_2.c,v 1.14 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_2.c,v 1.13 2001/01/01 21:57:37 jwise Exp $");
+__RCSID("$NetBSD: dr_2.c,v 1.14 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#define couldwin(f,t) (f->specs->crew2 > t->specs->crew2 * 1.5)
+void thinkofgrapples(void);
+void checkup(void);
+void prizecheck(void);
+static int str_end(const char *);
+void closeon(struct ship *, struct ship *, char *, int, int, int);
+static int score(char *, struct ship *, struct ship *, int);
+static void move_ship(const char *, struct ship *, unsigned char *, short *, short *, char *);
+static void try(char *, char *, int, int, int, int, int, struct ship *, struct ship *, int *, int);
+static void rmend(char *);
+
+const int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */
+
void
thinkofgrapples(void)
{
}
}
-int
+static int
str_end(const char *str)
{
const char *p;
try(command, temp, ma, ta, af, ma, from->file->dir, from, to, &high, 0);
}
-const int dtab[] = {0,1,1,2,3,4,4,5}; /* diagonal distances in x==y */
-
-int
+static int
score(char *movement, struct ship *ship, struct ship *to, int onlytemp)
{
char drift;
return total;
}
-void
+static void
move_ship(const char *p, struct ship *ship, unsigned char *dir, short *row, short *col, char *drift)
{
int dist;
*drift = 0;
}
-void
+static void
try(char *command, char *temp, int ma, int ta, int af, int vma, int dir, struct ship *f, struct ship *t, int *high, int rakeme)
{
int new, n;
}
}
-void
+static void
rmend(char *str)
{
char *p;
-/* $NetBSD: dr_3.c,v 1.9 2001/01/01 21:57:37 jwise Exp $ */
+/* $NetBSD: dr_3.c,v 1.10 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)dr_3.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dr_3.c,v 1.9 2001/01/01 21:57:37 jwise Exp $");
+__RCSID("$NetBSD: dr_3.c,v 1.10 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include "driver.h"
#include <stdlib.h>
+void moveall(void);
+static int stillmoving(int);
+static int is_isolated(struct ship *);
+static int push(struct ship *, struct ship *);
+static void step(int, struct ship *, char *);
+void sendbp(struct ship *, struct ship *, int, int);
+int is_toughmelee(struct ship *, struct ship *, int, int);
+void reload(void);
+void checksails(void);
+
/* move all comp ships */
void
moveall(void)
}
}
-int
+static int
stillmoving(int k)
{
struct ship *sp;
return 0;
}
-int
+static int
is_isolated(struct ship *ship)
{
struct ship *sp;
return 1;
}
-int
+static int
push(struct ship *from, struct ship *to)
{
int bs, sb;
return from < to;
}
-void
+static void
step(int com, struct ship *sp, char *moved)
{
int dist;
-/* $NetBSD: dr_4.c,v 1.9 2001/01/01 21:57:37 jwise Exp $ */
+/* $NetBSD: dr_4.c,v 1.10 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)dr_4.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: dr_4.c,v 1.9 2001/01/01 21:57:37 jwise Exp $");
+__RCSID("$NetBSD: dr_4.c,v 1.10 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include "extern.h"
#include <stdlib.h>
+void ungrap(struct ship *, struct ship *);
+void grap(struct ship *, struct ship *);
+
void
ungrap(struct ship *from, struct ship *to)
{
-/* $NetBSD: dr_5.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */
+/* $NetBSD: dr_5.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)dr_5.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: dr_5.c,v 1.7 2001/01/01 21:57:38 jwise Exp $");
+__RCSID("$NetBSD: dr_5.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include "extern.h"
+void subtract(struct ship *, int, int *, struct ship *, int);
+int mensent(struct ship *, struct ship *, int *, struct ship **, int *, int);
+
void
subtract(struct ship *from, int totalfrom, int *crewfrom, struct ship *fromcap, int pcfrom)
{
-/* $NetBSD: dr_main.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */
+/* $NetBSD: dr_main.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)dr_main.c 8.2 (Berkeley) 4/16/94";
#else
-__RCSID("$NetBSD: dr_main.c,v 1.7 2001/01/01 21:57:38 jwise Exp $");
+__RCSID("$NetBSD: dr_main.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include <stdlib.h>
#include <unistd.h>
+int dr_main(void);
+
int
dr_main(void)
{
-/* $NetBSD: extern.h,v 1.18 2001/01/01 21:57:38 jwise Exp $ */
+/* $NetBSD: extern.h,v 1.19 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
/* dr_1.c */
void unfoul (void);
void boardcomp (void);
-int fightitout (struct ship *, struct ship *, int);
void resolve (void);
void compcombat (void);
int next (void);
void thinkofgrapples (void);
void checkup (void);
void prizecheck (void);
-int str_end (const char *);
void closeon (struct ship *, struct ship *, char *, int, int, int);
-int score (char *, struct ship *, struct ship *, int);
-void move_ship (const char *, struct ship *, unsigned char *, short *, short *, char *);
-void try (char *, char *, int, int, int, int, int, struct ship *,
- struct ship *, int *, int);
-void rmend (char *);
/* dr_3.c */
void moveall (void);
-int stillmoving (int);
-int is_isolated (struct ship *);
-int push (struct ship *, struct ship *);
-void step (int, struct ship *, char *);
void sendbp (struct ship *, struct ship *, int, int);
int is_toughmelee (struct ship *, struct ship *, int, int);
void reload (void);
-/* $NetBSD: game.c,v 1.7 2001/01/01 21:57:38 jwise Exp $ */
+/* $NetBSD: game.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)game.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: game.c,v 1.7 2001/01/01 21:57:38 jwise Exp $");
+__RCSID("$NetBSD: game.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
#endif
#endif /* not lint */
#include "extern.h"
+int maxturns(struct ship *, char *);
+int maxmove(struct ship *, int, int);
+
int
maxturns(struct ship *ship, char *af)
{