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 >
Wrap
Text File
|
1992-08-10
|
545b
|
38 lines
#define GAME_C
#include <stdio.h>
#include <stdlib.h>
#include "game.h"
void piece_move(PIECE piece)
{
switch (piece->piece_type){
case PAWN:
pawn_move(piece->moves->PawnM);
break;
case BISHOP:
bishop_move(piece->moves->BishopM);
break;
case ROOK:
rook_move(piece->moves->RookM);
break;
case KING:
king_move(piece->moves->KingM);
break;
default:
fprintf(stderr, "Unknown Playing piece.\n");
exit (1);
}
}
void calling_func()
{
PIECE tmp;
/* set tmp equal to one of game pieces */
/*...*/
move_piece (tmp);
}