~ubuntu-branches/ubuntu/trusty/polyglot/trusty

« back to all changes in this revision

Viewing changes to move.h

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Korff
  • Date: 2005-10-09 21:56:20 UTC
  • Revision ID: james.westby@ubuntu.com-20051009215620-dcuqynujzvmiglpj
Tags: upstream-1.3
ImportĀ upstreamĀ versionĀ 1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// move.h
 
3
 
 
4
#ifndef MOVE_H
 
5
#define MOVE_H
 
6
 
 
7
// includes
 
8
 
 
9
#include "board.h"
 
10
#include "util.h"
 
11
 
 
12
// constants
 
13
 
 
14
const int MoveNone = 0; // HACK: a1a1 cannot be a legal move
 
15
 
 
16
const int MovePromoteKnight = 1 << 12;
 
17
const int MovePromoteBishop = 2 << 12;
 
18
const int MovePromoteRook   = 3 << 12;
 
19
const int MovePromoteQueen  = 4 << 12;
 
20
const int MoveFlags         = 7 << 12;
 
21
 
 
22
// types
 
23
 
 
24
typedef uint16 move_t;
 
25
 
 
26
// functions
 
27
 
 
28
extern bool move_is_ok          (int move);
 
29
 
 
30
extern int  move_make           (int from, int to);
 
31
extern int  move_make_flags     (int from, int to, int flags);
 
32
 
 
33
extern int  move_from           (int move);
 
34
extern int  move_to             (int move);
 
35
extern int  move_promote_hack   (int move);
 
36
 
 
37
extern bool move_is_capture     (int move, const board_t *board);
 
38
extern bool move_is_promote     (int move);
 
39
extern bool move_is_en_passant  (int move, const board_t *board);
 
40
extern bool move_is_castle      (int move, const board_t *board);
 
41
 
 
42
extern int  move_piece          (int move, const board_t *board);
 
43
extern int  move_capture        (int move, const board_t *board);
 
44
extern int  move_promote        (int move, const board_t *board);
 
45
 
 
46
extern bool move_is_check       (int move, const board_t *board);
 
47
extern bool move_is_mate        (int move, const board_t *board);
 
48
 
 
49
extern int  move_order          (int move);
 
50
 
 
51
extern bool move_to_can         (int move, char string[], int size);
 
52
extern int  move_from_can       (const char string[]);
 
53
 
 
54
extern void move_disp           (int move);
 
55
 
 
56
#endif // !defined MOVE_H
 
57
 
 
58
// end of move.h
 
59