home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / xtron-1_1a / xtron.h < prev    next >
C/C++ Source or Header  |  1995-04-16  |  2KB  |  56 lines

  1. /* tron.h - xtron v1.1 header for xtron.c
  2.  *
  3.  *   Copyright (C) 1995 Rhett D. Jacobs <rhett@hotel.canberra.edu.au>
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 1, or (at your option)
  8.  *  any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  Last Modified: 16/4/95
  20.  */
  21.  
  22. #ifndef _XTRON_H
  23. #define _XTRON_H
  24.  
  25. #define WIN_WIDTH 384
  26. #define WIN_HEIGHT 512
  27. #define DIMS (WIN_WIDTH/8)
  28. #define MAXVERT (WIN_WIDTH/8)
  29. #define MINVERT 0
  30. #define MAXHORZ (WIN_WIDTH/8)
  31. #define MINHORZ 0
  32.  
  33. enum directions {left, right, up, down};
  34. enum play_types {human, computer};
  35.  
  36. struct Player {
  37.   short int co_ords[2];
  38.   short int plr_num;  
  39.   int score;
  40.   int alive;
  41.   enum directions plr_dir;
  42.   enum play_types plr_type; 
  43. } p[2];
  44.  
  45. struct Board {
  46.   short int contents[200][200];
  47. } b;
  48.  
  49. void plr_setup(void);
  50. int plr_checkmove(int p_num, int new_val, int axis_type, enum directions dir);
  51. void plr_turn(int p_num, enum directions dir);
  52. void brd_setup(void);
  53. int brd_newcontents(int x, int y, int what);
  54.  
  55. #endif
  56.