File: ship.c

package info (click to toggle)
dangen 0.5-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,868 kB
  • sloc: ansic: 49,744; sh: 999; yacc: 494; makefile: 273; lex: 142
file content (31 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* $Id: ship.c,v 1.19 2005/06/30 15:09:26 oohara Exp $ */

#include <stdio.h>
/* strlen */
#include <string.h>

#include "ship.h"

static int ship = 5;

void
clear_ship(void)
{
  ship = 5;
}

/* return the new value of ships */
int
add_ship(int delta)
{
  ship += delta;
  if (ship < -1)
    ship = -1;
  return ship;
}

int
get_ship(void)
{
  return ship;
}