From 470109768f464356da978b54d0497112197e7479 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Sat, 6 Jul 2024 20:44:25 +0200 Subject: [PATCH] finalize hyperbola funcs/files rename: Makefile, wrong calls, etc... --- Makefile | 2 +- src/hq.c | 24 ++++++++++++------------ src/hq.h | 4 ++-- src/init.c | 2 +- test/attack-test.c | 2 +- test/bitboard-test.c | 2 +- test/movegen-test.c | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index b9635b1..9668cde 100644 --- a/Makefile +++ b/Makefile @@ -398,7 +398,7 @@ TEST += movedo-test perft-test tt-test PIECE_OBJS := piece.o FEN_OBJS := $(PIECE_OBJS) fen.o position.o bitboard.o board.o \ - hyperbola-quintessence.o attack.o hash.o init.o misc.o move.o + hq.o attack.o hash.o init.o misc.o move.o BB_OBJS := $(FEN_OBJS) MOVEGEN_OBJS := $(BB_OBJS) move-gen.o ATTACK_OBJS := $(MOVEGEN_OBJS) diff --git a/src/hq.c b/src/hq.c index 2b6853c..4e24552 100644 --- a/src/hq.c +++ b/src/hq.c @@ -1,4 +1,4 @@ -/* hyperbola-quintessence.c - hyperbola quintessence functions. +/* hq.c - hyperbola quintessence functions. * * Copyright (C) 2024 Bruno Raoult ("br") * Licensed under the GNU General Public License v3.0 or later. @@ -25,7 +25,7 @@ uchar bb_rank_attacks[64 * 8]; /** - * hyperbola_init() - init hyperbola quintessence attack bitboards + * hq_init() - init hyperbola quintessence attack bitboards * * See: https://www.chessprogramming.org/Kindergarten_Bitboards * and https://www.chessprogramming.org/Hyperbola_Quintessence @@ -45,11 +45,11 @@ uchar bb_rank_attacks[64 * 8]; * (O <<= 2) * * TODO ? create masks excluding slider (eg. bb_diag ^ bb_sq[square]), - * to save one operation in hyperbola_moves(). + * to save one operation in hq_moves(). * TODO ? replace rank attack with this idea, mapping rank to diagonal ? * See http://timcooijmans.blogspot.com/2014/04/ */ -void hyperbola_init() +void hq_init() { /* generate rank attacks, not handled by HQ */ @@ -86,7 +86,7 @@ void hyperbola_init() } /** - * hyperbola_rank_moves() - get rank moves for a sliding piece. + * hq_rank_moves() - get rank moves for a sliding piece. * @pieces: occupation bitboard * @sq: piece square * @@ -110,7 +110,7 @@ bitboard_t hq_rank_moves(bitboard_t occ, square_t sq) } /** - * hyperbola_moves() - get hyperbola pseudo-moves for a sliding piece + * hq_moves() - get hyperbola pseudo-moves for a sliding piece * @pieces: occupation bitboard * @sq: piece square * @mask: the appropriate mask (pre-calculated) @@ -135,7 +135,7 @@ bitboard_t hq_moves(const bitboard_t pieces, const square_t sq, } /** - * hyperbola_file_moves() - get file pseudo-moves for a sliding piece. + * hq_file_moves() - get file pseudo-moves for a sliding piece. * @pieces: occupation bitboard * @sq: piece square * @@ -147,7 +147,7 @@ bitboard_t hq_file_moves(const bitboard_t occ, const square_t sq) } /** - * hyperbola_diag_moves() - get diagonal pseudo-moves for a sliding piece. + * hq_diag_moves() - get diagonal pseudo-moves for a sliding piece. * @pieces: occupation bitboard * @sq: piece square * @@ -159,7 +159,7 @@ bitboard_t hq_diag_moves(const bitboard_t occ, const square_t sq) } /** - * hyperbola_anti_moves() - get anti-diagonal pseudo-moves for a sliding piece. + * hq_anti_moves() - get anti-diagonal pseudo-moves for a sliding piece. * @pieces: occupation bitboard * @sq: piece square * @@ -171,7 +171,7 @@ bitboard_t hq_anti_moves(const bitboard_t occ, const square_t sq) } /** - * hyperbola_bishop_moves() - get bitboard of bishop pseudo-moves + * hq_bishop_moves() - get bitboard of bishop pseudo-moves * @occ: occupation bitboard * @sq: bishop square * @@ -183,7 +183,7 @@ bitboard_t hq_bishop_moves(const bitboard_t occ, const square_t sq) } /** - * hyperbola_rook_moves() - get bitboard of rook pseudo-moves + * hq_rook_moves() - get bitboard of rook pseudo-moves * @occ: occupation bitboard * @sq: rook square * @@ -195,7 +195,7 @@ bitboard_t hq_rook_moves(const bitboard_t occ, const square_t sq) } /** - * hyperbola_queen_moves() - get bitboard of queen pseudo-moves + * hq_queen_moves() - get bitboard of queen pseudo-moves * @occ: occupation bitboard * @sq: queen square * diff --git a/src/hq.h b/src/hq.h index 1657d50..0f099c3 100644 --- a/src/hq.h +++ b/src/hq.h @@ -1,4 +1,4 @@ -/* hyperbola-quintessence.h - hyperbola-quintessence definitions. +/* hq.h - hyperbola-quintessence definitions. * * Copyright (C) 2024 Bruno Raoult ("br") * Licensed under the GNU General Public License v3.0 or later. @@ -17,7 +17,7 @@ #include "board.h" #include "bitboard.h" -void hyperbola_init(void); +void hq_init(void); bitboard_t hq_rank_moves(const bitboard_t occ, const square_t sq); bitboard_t hq_moves(const bitboard_t pieces, const square_t sq, diff --git a/src/init.c b/src/init.c index 0ed59a7..fdf8173 100644 --- a/src/init.c +++ b/src/init.c @@ -43,7 +43,7 @@ void init_all(void) bitboard_init(); printff("hq bitboards... "); - hyperbola_init(); + hq_init(); /* zobrist tables & default tt hashtable */ printff("zobrist tables... "); diff --git a/test/attack-test.c b/test/attack-test.c index 2836e1f..a31fcbb 100644 --- a/test/attack-test.c +++ b/test/attack-test.c @@ -33,7 +33,7 @@ int main(int __unused ac, __unused char**av) setlinebuf(stdout); /* line-buffered stdout */ bitboard_init(); - hyperbola_init(); + hq_init(); while ((fen = next_fen(ATTACK))) { //printf(">>>>> %s\n", test[i]); diff --git a/test/bitboard-test.c b/test/bitboard-test.c index 75b272d..daf2bf8 100644 --- a/test/bitboard-test.c +++ b/test/bitboard-test.c @@ -24,7 +24,7 @@ int main(int __unused ac, __unused char**av) { char str[256]; bitboard_init(); - hyperbola_init(); + hq_init(); for (int i = 0; i < 64; ++i) { sprintf(str, "\n%#x:\n %-22s%-22s%-22s%-22s%-22s%-22s%-22s", i, "sliding", "diagonal", "antidiagonal", "file", "rank", "knight", diff --git a/test/movegen-test.c b/test/movegen-test.c index 4452fd2..f8d88b5 100644 --- a/test/movegen-test.c +++ b/test/movegen-test.c @@ -224,7 +224,7 @@ int main(int __unused ac, __unused char**av) setlinebuf(stdout); /* line-buffered stdout */ bitboard_init(); - hyperbola_init(); + hq_init(); outfd = open_stockfish(); while ((fen = next_fen(MOVEGEN))) {