My Project
Macros | Typedefs | Enumerations | Functions | Variables
generate_flip.c File Reference
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <limits.h>

Macros

#define MERGE_DIAGONALS   3
 
#define foreach_bits(i, b)   for (i = first_one(b); b; i = next_one(&b, i))
 
#define print_bitarray(a)   (print_bitarray_)(f, a, (sizeof a)/(sizeof a[0]), #a)
 

Typedefs

typedef unsigned long long uint64
 
typedef unsigned char uint8
 

Enumerations

enum  {
  A1 , B1 , C1 , D1 ,
  E1 , F1 , G1 , H1 ,
  A2 , B2 , C2 , D2 ,
  E2 , F2 , G2 , H2 ,
  A3 , B3 , C3 , D3 ,
  E3 , F3 , G3 , H3 ,
  A4 , B4 , C4 , D4 ,
  E4 , F4 , G4 , H4 ,
  A5 , B5 , C5 , D5 ,
  E5 , F5 , G5 , H5 ,
  A6 , B6 , C6 , D6 ,
  E6 , F6 , G6 , H6 ,
  A7 , B7 , C7 , D7 ,
  E7 , F7 , G7 , H7 ,
  A8 , B8 , C8 , D8 ,
  E8 , F8 , G8 , H8
}
 

Functions

int first_one (uint64 b)
 
int next_one (uint64 *b, int x)
 
int count (uint64 b)
 
uint64 P (uint64 mask, const uint64 flat)
 
void print_bitboard (uint64 b, FILE *f)
 
void print_bitline (uint8 l, FILE *f)
 
uint64 h_mask (int x, int a, int b)
 
uint64 v_mask (int x, int a, int b)
 
uint64 d7_mask (int x, int a, int b)
 
uint64 d9_mask (int x, int a, int b)
 
uint64 d_mask (int x, int a, int b)
 
uint64 d_add (int x, int a, int b)
 
uint8 h_to_line (uint64 b, int x)
 
uint8 v_to_line (uint64 b, int x)
 
uint8 d7_to_line (uint64 b, int x)
 
uint8 d9_to_line (uint64 b, int x)
 
uint8 d_to_line (uint64 b, int x)
 
int flip_index_h (int x)
 
int v_flip_index (int x)
 
int d7_flip_index (int x)
 
int d9_flip_index (int x)
 
int d_flip_index (int x)
 
int flip_count (int l, int x)
 
int outflank (int o, int x)
 
int flip (int of, int x)
 
char * h_name (int x)
 
char * v_name (int x)
 
char * d7_name (int x)
 
int d7_shift_index (int x)
 
char * d9_name (int x)
 
int d9_shift_index (int x)
 
char * d_name (const int x)
 
void init_index_to_bitarray ()
 
void print_bitarray_ (FILE *f, uint64 array[], int size, char *name)
 
int main ()
 

Variables

const uint64 BIT [64]
 
uint64 B1G1 [64]
 
uint64 B2G2 [64]
 
uint64 B3G3 [64]
 
uint64 B4G4 [64]
 
uint64 B5G5 [64]
 
uint64 B6G6 [64]
 
uint64 B7G7 [64]
 
uint64 B8G8 [64]
 
uint64 A2A7 [64]
 
uint64 B2B7 [64]
 
uint64 C2C7 [64]
 
uint64 D2D7 [64]
 
uint64 E2E7 [64]
 
uint64 F2F7 [64]
 
uint64 G2G7 [64]
 
uint64 H2H7 [64]
 
uint64 B2B2 [2]
 
uint64 C2B3 [4]
 
uint64 D2B4 [8]
 
uint64 E2B5 [16]
 
uint64 F2B6 [32]
 
uint64 G2B7 [64]
 
uint64 G3C7 [32]
 
uint64 G4D7 [16]
 
uint64 G5E7 [8]
 
uint64 G6F7 [4]
 
uint64 G7G7 [2]
 
uint64 B7B7 [2]
 
uint64 B6C7 [4]
 
uint64 B5D7 [8]
 
uint64 B4E7 [16]
 
uint64 B3F7 [32]
 
uint64 B2G7 [64]
 
uint64 C2G6 [32]
 
uint64 D2G5 [16]
 
uint64 E2G4 [8]
 
uint64 F2G3 [4]
 
uint64 G2G2 [2]
 
uint64 G2H3D7 [64]
 
uint64 F2H4E7 [64]
 
uint64 E2H5F7 [64]
 
uint64 D2H6G7 [64]
 
uint64 F2G3C7 [64]
 
uint64 E2G4D7 [64]
 
uint64 D2G5E7 [64]
 
uint64 C2G6F7 [64]
 
uint64 B2A3E7 [64]
 
uint64 C2A4D7 [64]
 
uint64 D2A5C7 [64]
 
uint64 E2A6B7 [64]
 
uint64 C2B3F7 [64]
 
uint64 D2B4E7 [64]
 
uint64 E2B5D7 [64]
 
uint64 F2B6C7 [64]
 
uint64 B2C1G5 [64]
 
uint64 B3D1G4 [64]
 
uint64 B4E1G3 [64]
 
uint64 B5F1G2 [64]
 
uint64 B3C2G6 [64]
 
uint64 B4D2G5 [64]
 
uint64 B5E2G4 [64]
 
uint64 B6F2G3 [64]
 
uint64 B7C8G4 [64]
 
uint64 B6D8G5 [64]
 
uint64 B5E8G6 [64]
 
uint64 B4F8G7 [64]
 
uint64 B6C7G3 [64]
 
uint64 B5D7G4 [64]
 
uint64 B4E7G5 [64]
 
uint64 B3F7G6 [64]
 

Detailed Description

This program generates the flip_kindergarten.c file.

Date
1998 - 2017
Author
Richard Delorme
Version
4.4

Macro Definition Documentation

◆ foreach_bits

#define foreach_bits (   i,
 
)    for (i = first_one(b); b; i = next_one(&b, i))

◆ MERGE_DIAGONALS

#define MERGE_DIAGONALS   3

◆ print_bitarray

#define print_bitarray (   a)    (print_bitarray_)(f, a, (sizeof a)/(sizeof a[0]), #a)

Typedef Documentation

◆ uint64

typedef unsigned long long uint64

◆ uint8

typedef unsigned char uint8

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
A1 
B1 
C1 
D1 
E1 
F1 
G1 
H1 
A2 
B2 
C2 
D2 
E2 
F2 
G2 
H2 
A3 
B3 
C3 
D3 
E3 
F3 
G3 
H3 
A4 
B4 
C4 
D4 
E4 
F4 
G4 
H4 
A5 
B5 
C5 
D5 
E5 
F5 
G5 
H5 
A6 
B6 
C6 
D6 
E6 
F6 
G6 
H6 
A7 
B7 
C7 
D7 
E7 
F7 
G7 
H7 
A8 
B8 
C8 
D8 
E8 
F8 
G8 
H8 

Function Documentation

◆ count()

int count ( uint64  b)
inline

◆ d7_flip_index()

int d7_flip_index ( int  x)

◆ d7_mask()

uint64 d7_mask ( int  x,
int  a,
int  b 
)

◆ d7_name()

char * d7_name ( int  x)

◆ d7_shift_index()

int d7_shift_index ( int  x)

◆ d7_to_line()

uint8 d7_to_line ( uint64  b,
int  x 
)

◆ d9_flip_index()

int d9_flip_index ( int  x)

◆ d9_mask()

uint64 d9_mask ( int  x,
int  a,
int  b 
)

◆ d9_name()

char * d9_name ( int  x)

◆ d9_shift_index()

int d9_shift_index ( int  x)

◆ d9_to_line()

uint8 d9_to_line ( uint64  b,
int  x 
)

◆ d_add()

uint64 d_add ( int  x,
int  a,
int  b 
)

◆ d_flip_index()

int d_flip_index ( int  x)

◆ d_mask()

uint64 d_mask ( int  x,
int  a,
int  b 
)

◆ d_name()

char * d_name ( const int  x)

◆ d_to_line()

uint8 d_to_line ( uint64  b,
int  x 
)

◆ first_one()

int first_one ( uint64  b)

◆ flip()

int flip ( int  of,
int  x 
)

◆ flip_count()

int flip_count ( int  l,
int  x 
)

◆ flip_index_h()

int flip_index_h ( int  x)

◆ h_mask()

uint64 h_mask ( int  x,
int  a,
int  b 
)

◆ h_name()

char * h_name ( int  x)

◆ h_to_line()

uint8 h_to_line ( uint64  b,
int  x 
)

◆ init_index_to_bitarray()

void init_index_to_bitarray ( )

◆ main()

int main ( )

◆ next_one()

int next_one ( uint64 b,
int  x 
)
inline

◆ outflank()

int outflank ( int  o,
int  x 
)

◆ P()

uint64 P ( uint64  mask,
const uint64  flat 
)

◆ print_bitarray_()

void print_bitarray_ ( FILE *  f,
uint64  array[],
int  size,
char *  name 
)

◆ print_bitboard()

void print_bitboard ( uint64  b,
FILE *  f 
)

◆ print_bitline()

void print_bitline ( uint8  l,
FILE *  f 
)

◆ v_flip_index()

int v_flip_index ( int  x)

◆ v_mask()

uint64 v_mask ( int  x,
int  a,
int  b 
)

◆ v_name()

char * v_name ( int  x)

◆ v_to_line()

uint8 v_to_line ( uint64  b,
int  x 
)

Variable Documentation

◆ A2A7

uint64 A2A7[64]

◆ B1G1

uint64 B1G1[64]

◆ B2A3E7

uint64 B2A3E7[64]

◆ B2B2

uint64 B2B2[2]

◆ B2B7

uint64 B2B7[64]

◆ B2C1G5

uint64 B2C1G5[64]

◆ B2G2

uint64 B2G2[64]

◆ B2G7

uint64 B2G7[64]

◆ B3C2G6

uint64 B3C2G6[64]

◆ B3D1G4

uint64 B3D1G4[64]

◆ B3F7

uint64 B3F7[32]

◆ B3F7G6

uint64 B3F7G6[64]

◆ B3G3

uint64 B3G3[64]

◆ B4D2G5

uint64 B4D2G5[64]

◆ B4E1G3

uint64 B4E1G3[64]

◆ B4E7

uint64 B4E7[16]

◆ B4E7G5

uint64 B4E7G5[64]

◆ B4F8G7

uint64 B4F8G7[64]

◆ B4G4

uint64 B4G4[64]

◆ B5D7

uint64 B5D7[8]

◆ B5D7G4

uint64 B5D7G4[64]

◆ B5E2G4

uint64 B5E2G4[64]

◆ B5E8G6

uint64 B5E8G6[64]

◆ B5F1G2

uint64 B5F1G2[64]

◆ B5G5

uint64 B5G5[64]

◆ B6C7

uint64 B6C7[4]

◆ B6C7G3

uint64 B6C7G3[64]

◆ B6D8G5

uint64 B6D8G5[64]

◆ B6F2G3

uint64 B6F2G3[64]

◆ B6G6

uint64 B6G6[64]

◆ B7B7

uint64 B7B7[2]

◆ B7C8G4

uint64 B7C8G4[64]

◆ B7G7

uint64 B7G7[64]

◆ B8G8

uint64 B8G8[64]

◆ BIT

const uint64 BIT[64]
Initial value:
= {
0x0000000000000001, 0x0000000000000002, 0x0000000000000004, 0x0000000000000008,
0x0000000000000010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080,
0x0000000000000100, 0x0000000000000200, 0x0000000000000400, 0x0000000000000800,
0x0000000000001000, 0x0000000000002000, 0x0000000000004000, 0x0000000000008000,
0x0000000000010000, 0x0000000000020000, 0x0000000000040000, 0x0000000000080000,
0x0000000000100000, 0x0000000000200000, 0x0000000000400000, 0x0000000000800000,
0x0000000001000000, 0x0000000002000000, 0x0000000004000000, 0x0000000008000000,
0x0000000010000000, 0x0000000020000000, 0x0000000040000000, 0x0000000080000000,
0x0000000100000000, 0x0000000200000000, 0x0000000400000000, 0x0000000800000000,
0x0000001000000000, 0x0000002000000000, 0x0000004000000000, 0x0000008000000000,
0x0000010000000000, 0x0000020000000000, 0x0000040000000000, 0x0000080000000000,
0x0000100000000000, 0x0000200000000000, 0x0000400000000000, 0x0000800000000000,
0x0001000000000000, 0x0002000000000000, 0x0004000000000000, 0x0008000000000000,
0x0010000000000000, 0x0020000000000000, 0x0040000000000000, 0x0080000000000000,
0x0100000000000000, 0x0200000000000000, 0x0400000000000000, 0x0800000000000000,
0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000
}

◆ C2A4D7

uint64 C2A4D7[64]

◆ C2B3

uint64 C2B3[4]

◆ C2B3F7

uint64 C2B3F7[64]

◆ C2C7

uint64 C2C7[64]

◆ C2G6

uint64 C2G6[32]

◆ C2G6F7

uint64 C2G6F7[64]

◆ D2A5C7

uint64 D2A5C7[64]

◆ D2B4

uint64 D2B4[8]

◆ D2B4E7

uint64 D2B4E7[64]

◆ D2D7

uint64 D2D7[64]

◆ D2G5

uint64 D2G5[16]

◆ D2G5E7

uint64 D2G5E7[64]

◆ D2H6G7

uint64 D2H6G7[64]

◆ E2A6B7

uint64 E2A6B7[64]

◆ E2B5

uint64 E2B5[16]

◆ E2B5D7

uint64 E2B5D7[64]

◆ E2E7

uint64 E2E7[64]

◆ E2G4

uint64 E2G4[8]

◆ E2G4D7

uint64 E2G4D7[64]

◆ E2H5F7

uint64 E2H5F7[64]

◆ F2B6

uint64 F2B6[32]

◆ F2B6C7

uint64 F2B6C7[64]

◆ F2F7

uint64 F2F7[64]

◆ F2G3

uint64 F2G3[4]

◆ F2G3C7

uint64 F2G3C7[64]

◆ F2H4E7

uint64 F2H4E7[64]

◆ G2B7

uint64 G2B7[64]

◆ G2G2

uint64 G2G2[2]

◆ G2G7

uint64 G2G7[64]

◆ G2H3D7

uint64 G2H3D7[64]

◆ G3C7

uint64 G3C7[32]

◆ G4D7

uint64 G4D7[16]

◆ G5E7

uint64 G5E7[8]

◆ G6F7

uint64 G6F7[4]

◆ G7G7

uint64 G7G7[2]

◆ H2H7

uint64 H2H7[64]