rename base.h -> engine.h and fix bugs in codegen
This commit is contained in:
2
Makefile
2
Makefile
@@ -30,5 +30,5 @@ mbb_rook.h: codegen
|
|||||||
mbb_bishop.h: codegen
|
mbb_bishop.h: codegen
|
||||||
./codegen
|
./codegen
|
||||||
|
|
||||||
tests: tests.c mbb_rook.h mbb_bishop.h base.h
|
tests: tests.c mbb_rook.h mbb_bishop.h engine.h
|
||||||
$(CC) -o $@ $(CFLAGS) tests.c
|
$(CC) -o $@ $(CFLAGS) tests.c
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#define CODEGEN
|
#define CODEGEN
|
||||||
#include "base.h"
|
#include "engine.h"
|
||||||
|
#include "libc-lite.h"
|
||||||
|
#include "board_print.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ int main()
|
|||||||
|
|
||||||
/* brute force the magic number */
|
/* brute force the magic number */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
bitboard magic = rand64() & rand64() & rand64();
|
bitboard magic = my_rand64() & my_rand64() & my_rand64();
|
||||||
|
|
||||||
bitboard atk = 0ULL;
|
bitboard atk = 0ULL;
|
||||||
for (bitboard test = 0; test < (1ULL<<rook_relevant_bits_count); test++) {
|
for (bitboard test = 0; test < (1ULL<<rook_relevant_bits_count); test++) {
|
||||||
@@ -120,7 +122,7 @@ int main()
|
|||||||
/* brute force the magic number */
|
/* brute force the magic number */
|
||||||
bitboard magic = 0ULL;
|
bitboard magic = 0ULL;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
magic = rand64() & rand64() & rand64();
|
magic = my_rand64() & my_rand64() & my_rand64();
|
||||||
|
|
||||||
bitboard atk = 0ULL;
|
bitboard atk = 0ULL;
|
||||||
for (bitboard test = 0; test < (1ULL<<bishop_relevant_bits_count); test++) {
|
for (bitboard test = 0; test < (1ULL<<bishop_relevant_bits_count); test++) {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|||||||
2
tests.c
2
tests.c
@@ -2,7 +2,7 @@
|
|||||||
#define _XOPEN_SOURCE 500
|
#define _XOPEN_SOURCE 500
|
||||||
#include <unistd.h> /* usleep */
|
#include <unistd.h> /* usleep */
|
||||||
|
|
||||||
#include "base.h"
|
#include "engine.h"
|
||||||
#include "board_print.h"
|
#include "board_print.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include "base.h"
|
#include "engine.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user