Skip to content

Commit b93ed12

Browse files
author
Jesper Torp Kristensen
committed
Now works on a 64 bit Mac version 10.6.8 (but probably not much else).
1 parent a8d70de commit b93ed12

File tree

91 files changed

+2274
-12629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2274
-12629
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
*~
33
*/*~
44

5+
# Eclipse files
6+
.project
7+
.cproject
8+
59
# Auto generated files
610
*.o
711
*.d
12+
Debug/*
13+
chess
14+
big_output.txt
15+
incoming.txt
16+
backup.pgn
17+

backup

Lines changed: 0 additions & 22 deletions
This file was deleted.

cleanup

Lines changed: 0 additions & 1 deletion
This file was deleted.

default.set

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,14 @@ Endgame_mark_unreachable_as_dont_cares = true
5757
// if 0, then only static test is performed, otherwise n moves is tried undone
5858
Endgame_unreachability_depth_test = 3
5959

60-
Endgame_directory = "/users/doktoren/public_html/master_thesis/endgames/"
61-
62-
Endgame_verify_bdd_with_table = true
60+
Endgame_directory = "endgames/"
6361

6462
// 0 = simple method, 1 = retrograde
6563
Endgame_construction_method = 1
6664

6765
// If ...show_progress, then for each new mate depth a winning/losing position is shown
6866
Endgame_construction_show_progress = true
6967

70-
// Determines which endgame is used by engine. 0:own endgames, 1:Nalimov
71-
Endgame_active_endgame = 0
72-
73-
// Must be at least 16384
74-
Endgame_Nalimov_cache_size = 1048576
75-
76-
Endgame_Nalimov_directory = "/users/doktoren/public_html/master_thesis/Nalimov/"
77-
7868
//NDEBUG = false
7969
Eval3_show_evaluation_info = false
8070

@@ -136,7 +126,7 @@ Search3_show_line_of_play = false
136126
Search3_show_value_of_each_move_from_root = true
137127

138128
//NDEBUG : setting still enabled. Only used if XBOARD not defined
139-
Search3_time_per_move_in_ms = 20000
129+
Search3_time_per_move_in_ms = 2000
140130

141131
//NDEBUG : not used (false)
142132
Search3_trace_search = true

help.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

kill

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Makefile

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
CXX = g++
22

3-
# -Q is a good option for debugging
4-
CFLAGS = -Wall -g -ggdb -DNDEBUG
5-
#CFLAGS = -O3 -Wall -pedantic -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors -DNDEBUG -ffast-math -fomit-frame-pointer
6-
CFLAGS_DB = -ggdb3 -pg -Wall -pedantic -ansi# -march=pentium4 -Woverloaded-virtual -felide-constructors
7-
CFLAGS_XB = -O3 -Wall -pedantic -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors -DNDEBUG -DXBOARD -ffast-math -fomit-frame-pointer
8-
CFLAGS_DB_XB = -ggdb3 -pg -Wall -pedantic -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors -DXBOARD
3+
CFLAGS = -O3 -arch x86_64 -Wall -pedantic -ansi -DNDEBUG
4+
CFLAGS_DB = -ggdb3 -pg -Wall -pedantic -ansi
5+
CFLAGS_XB = -O3 -Wall -pedantic -ansi -DNDEBUG -DXBOARD
6+
CFLAGS_DB_XB = -ggdb3 -pg -Wall -pedantic -ansi -DXBOARD
97

10-
CFLAGS_NALIMOV = -O3 -DNDEBUG -Wall -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors
11-
CFLAGS_NALIMOV_DB = -Wall -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors
12-
13-
#TEST = -ggdb3 -O3 -Wall -pedantic -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors -ffast-math -fno-strict-aliasing
14-
15-
TEST = -ggdb3 -O3 -pg -Wall -pedantic -ansi -march=pentium4 -Woverloaded-virtual -felide-constructors
16-
17-
# tilføj chess.o ?
18-
# put endgame_database.o tilbage (før chess.o)
198
MODS = board.o endgame_table_bdd.o mapping_of_wildcards.o \
209
endgame_run_length_encoding.o run_length_encoding/bit_stream.o \
21-
endgame_clustering_functions.o endgame_Nalimov.o board_2.o endgame_castling.o \
10+
endgame_clustering_functions.o board_2.o endgame_castling.o \
2211
endgame_piece_enumerations.o endgame_square_permutations.o \
2312
binary_decision_diagram.o endgame_database.o endgame_indexing.o endgame_en_passant.o \
2413
\
@@ -48,29 +37,10 @@ chess: $(MODS)
4837
%.o: %.cxx
4938
$(CXX) $(CFLAGS) -c -o $@ $<
5039

51-
#endgame_Nalimov.o:
52-
# $(CXX) -c $(CFLAGS_NALIMOV) $< -o $@
53-
54-
#board.o: board.cxx
55-
# $(CXX) $(CFLAGS) -c -o $@ $<
56-
5740
%.d: %.cxx
5841
g++ -MM $< -o $@
5942

6043
include ${MODS:.o=.d}
6144

6245
clean:
63-
-rm -f *.o
64-
65-
#clean:
66-
# -/bin/rm -f *.d
67-
# -rm -f *~
68-
# -rm -f *.o
69-
70-
#rm -f test *~ *.d *.o */*~ */*.d */*.o
71-
72-
#rm -f test *~ *.d *.o .\#* \#* a.out chess core tmp.* .nfs* incoming.txt big_output.txt probe_Nalimov/*~ probe_Nalimov/test help_programs/*~ help_programs/test help_programs/a.out run_length_encoding/*~ run_length_encoding/*.o
73-
74-
#gprof chess -b --ignore-non-functions >profiling.txt
75-
76-
# http://www.gnu.org/software/make/manual/make.html#Automatic-Variables
46+
-rm -f *.o *.d */*.o */*.d

src/board.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ index database
10131013
//#############################################################
10141014

10151015

1016-
bool Board::clr_board(void *ignored, Board *board, ostream& os, vector<string> &p) {
1016+
bool Board::clr_board(Board *board, ostream& os, vector<string> &p) {
10171017
Board *_b = reinterpret_cast<Board *>(board);
10181018
Board &b = *dynamic_cast<Board *>(_b);
10191019

src/board.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public:
479479

480480

481481
// clr_board : clr is an abbreviation for command line receiver
482-
static bool clr_board(void *ignored, Board *board, ostream& os, vector<string> &p);
482+
static bool clr_board(Board *board, ostream& os, vector<string> &p);
483483
void print_board(ostream& os) const;
484484
void print_counters(ostream &os);
485485

src/board_2.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Move Board2::moves_from_to(Position pos, Position dest) const {
227227
// Returns true if
228228
// a) the move is a castling move
229229
// b) something prevents the player to castle
230-
inline bool Board2::is_illegal_castling_move(Move move) const {
230+
bool Board2::is_illegal_castling_move(Move move) const {
231231
//cerr << "Checking " << move.toString() << "\n";
232232

233233
if (CASTLING[move.from] && CASTLING[move.to]) {
@@ -263,7 +263,7 @@ inline bool Board2::is_illegal_castling_move(Move move) const {
263263
// If it is a king move, bit_board must be updated.
264264
// (move.blah & PROTECTS_KING <=> Check if piece moved) must hold.
265265
// Will update move.special_move if it returns true.
266-
inline bool Board2::legal_move(Move& move) const {
266+
bool Board2::legal_move(Move& move) const {
267267
assert(legal_pos(move.from) && legal_pos(move.to) && board[move.from]);
268268

269269
if (PIECE_COLOR[board[move.to]] == player) return false;
@@ -325,7 +325,7 @@ inline bool Board2::legal_move(Move& move) const {
325325
}
326326

327327
// assumptions made about move
328-
inline bool Board2::obstacle_free_move(Move move) const {
328+
bool Board2::obstacle_free_move(Move move) const {
329329
if (IS_KNIGHT_OR_KING[board[move.from]]) return true;
330330
if (PIECE_KIND[board[move.from]] == PAWN) {
331331
// obst. free if either a) the move is not move 2 forward, or
@@ -341,7 +341,7 @@ inline bool Board2::obstacle_free_move(Move move) const {
341341
return true;
342342
}
343343

344-
inline bool Board2::next_move_fixed_destination(Move &move, Piece piece_kind) const {
344+
bool Board2::next_move_fixed_destination(Move &move, Piece piece_kind) const {
345345
if (move.to & 0x80) {
346346
// Try <move.from, move.to-0x80> next
347347
move.to -= 0x80;
@@ -587,7 +587,7 @@ void Board2::undo_move(Move move, Undo undo) {
587587
// insert_piece, remove_piece and move_piece are declared virtual.
588588
// It will be very usefull to be able to extend them later on.
589589

590-
inline void Board2::bit_board_insert(Position pos, Piece piece, bool player) {
590+
void Board2::bit_board_insert(Position pos, Piece piece, bool player) {
591591
ull rest = BIT_BOARDS[piece][pos];
592592
if (rest[king_pos[player^1]]) {
593593
//cerr << "Add check for " << PIECE_NAME[piece] << " at " << POS_NAME[pos] << '\n';
@@ -607,7 +607,7 @@ inline void Board2::bit_board_insert(Position pos, Piece piece, bool player) {
607607
rest = new_rest;
608608
}
609609
}
610-
inline void Board2::bit_board_remove(Position pos, Piece piece, bool player) {
610+
void Board2::bit_board_remove(Position pos, Piece piece, bool player) {
611611
bit_boards[0][player] &= ~BIT_BOARDS[piece][pos];
612612
int i=0;
613613
ull diff = (~bit_boards[i][player]) & bit_boards[i+1][player];
@@ -726,7 +726,7 @@ void Board2::place_kings(Position white_king, Position black_king) {
726726
//#####################################################################
727727

728728

729-
bool Board2::clr_board2(void *ignored, Board *board, ostream& os, vector<string> &p) {
729+
bool Board2::clr_board2(Board *board, ostream& os, vector<string> &p) {
730730
Board *_b = reinterpret_cast<Board *>(board);
731731
Board2 &b = *dynamic_cast<Board2 *>(_b);
732732

@@ -1692,7 +1692,7 @@ struct EnPassantPP {
16921692
};
16931693

16941694

1695-
inline Position Board2::captured_en_passant_pawn(Position from, Position pawn_capture_pos) {
1695+
Position Board2::captured_en_passant_pawn(Position from, Position pawn_capture_pos) {
16961696
int dr = player ? 8 : -8;
16971697
// Check that:
16981698
// 1) 2 squares behind captured pawn are empty

0 commit comments

Comments
 (0)