aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/util.c b/util.c
index 993bd39..42db012 100644
--- a/util.c
+++ b/util.c
@@ -77,6 +77,22 @@ settiles(Map *m, Point2 cell, int o, int ncells, int type)
}
}
+void
+fprintmap(int fd, Map *m)
+{
+ int i, j;
+
+ for(i = 0; i < MAPH; i++){
+ fprint(fd, "\t");
+ for(j = 0; j < MAPW; j++)
+ switch(m->map[j][i]){
+ case Twater: fprint(fd, "W"); break;
+ case Tship: fprint(fd, "S"); break;
+ }
+ fprint(fd, "\n");
+ }
+}
+
int
shiplen(int stype)
{