1 #ifndef __LL_CHALLENGE__
2 #define __LL_CHALLENGE__
10 typedef enum { kUnknown=0,
11 kMarshall=1,kGeneral,kColonel,kMajor,kCaptain,
12 kLieutenant,kSergeant,kMiner,kScout,kSpy,
17 kMoved, // fake rank for moved pieces
18 kAddForRankish // add this in for enemies when calculating the CRC
21 #define kPieceCharacters "0123456789sBF.+MA"
23 typedef enum {kNoColor, kRed, kBlue} PlayerColor;
25 typedef struct PieceType {
26 PieceRank thePieceRank; /* rank of a piece */
27 PlayerColor thePieceColor; /* color of a piece */
30 typedef PieceType Board[kBoardSize][kBoardSize];
31 /* Used to provide test code with board configuration. Red starts
32 in rows 0..3, Blue starts in rows 6..9 */
33 /* Squares [4][2], [4][3], [4][6], [4][7] and
34 [5][2], [5][3], [5][6], [5][7] are water and cannot
37 typedef struct PiecePosition {
42 typedef struct MoveResult {
43 PieceType rankOfAttacker;
44 /* after a strike, returns identity of attacker */
45 PieceType rankOfDefender;
46 /* after a strike, returns identity of defender */
47 Boolean attackerRemoved;
48 /* true after a strike against a piece of equal or greater rank,
49 or against a bomb when the attacker is not a Miner */
50 Boolean defenderRemoved;
51 /* true after a strike by a piece of equal or greater rank,
52 or against a bomb when the attacker is a Miner,
53 or against a Marshall by a Spy */
55 /* true after a strike against the Flag */
58 - move into an occupied square, or
59 - move or strike in a direction other than forward, backward, or sideways, or
60 - move more than one square (except Scouts), or
61 - move a Bomb or a Flag,
63 - strike a square not occupied by an opponent, or
64 - make any other illegal move */