File: xtron.h

package info (click to toggle)
xtron 1.1a-17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 416 kB
  • sloc: ansic: 914; makefile: 17
file content (59 lines) | stat: -rw-r--r-- 1,603 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* tron.h - xtron v1.1 header for xtron.c
 *
 *   Copyright (C) 1995 Rhett D. Jacobs <rhett@hotel.canberra.edu.au>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 1, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  Last Modified: 16/4/95
 */

#ifndef _XTRON_H
#define _XTRON_H

#define WIN_WIDTH 384
#define WIN_HEIGHT 512
#define DIMS (WIN_WIDTH/8)
#define MAXVERT (WIN_WIDTH/8)
#define MINVERT 0
#define MAXHORZ (WIN_WIDTH/8)
#define MINHORZ 0

enum directions {left, right, up, down};
enum play_types {human, computer};

struct Player {
  short int co_ords[2];
  short int plr_num;  
  int score;
  int alive;
  enum directions plr_dir;
  enum play_types plr_type; 
};

extern struct Player p[2];

struct Board {
  short int contents[200][200];
};

extern struct Board b;
 
void plr_setup(void);
int plr_checkmove(int p_num, int new_val, int axis_type, enum directions dir);
void plr_turn(int p_num, enum directions dir);
void brd_setup(void);
int brd_newcontents(int x, int y, int what);

#endif