1 /* $Id: ship.c,v 1.19 2005/06/30 15:09:26 oohara Exp $ */ 2 3 #include <stdio.h> 4 /* strlen */ 5 #include <string.h> 6 7 #include "ship.h" 8 9 static int ship = 5; 10 11 void clear_ship(void)12clear_ship(void) 13 { 14 ship = 5; 15 } 16 17 /* return the new value of ships */ 18 int add_ship(int delta)19add_ship(int delta) 20 { 21 ship += delta; 22 if (ship < -1) 23 ship = -1; 24 return ship; 25 } 26 27 int get_ship(void)28get_ship(void) 29 { 30 return ship; 31 } 32