home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010106a < prev    next >
Text File  |  1992-08-10  |  545b  |  38 lines

  1. #define GAME_C
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include "game.h"
  6.  
  7.  
  8. void piece_move(PIECE piece)
  9. {
  10.     switch (piece->piece_type){
  11.     case PAWN:
  12.         pawn_move(piece->moves->PawnM);
  13.         break;
  14.     case BISHOP:
  15.         bishop_move(piece->moves->BishopM);
  16.         break;
  17.     case ROOK:
  18.         rook_move(piece->moves->RookM);
  19.         break;
  20.     case KING:
  21.         king_move(piece->moves->KingM);
  22.         break;
  23.     default:
  24.         fprintf(stderr, "Unknown Playing piece.\n");
  25.         exit (1);
  26.     }
  27. }
  28.  
  29. void calling_func()
  30. {
  31.     PIECE tmp;
  32.  
  33.     /* set tmp equal to one of game pieces */
  34.     /*...*/
  35.     move_piece (tmp);
  36. }
  37.  
  38.