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

Macros

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

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,
  PASS
}
 

Functions

int first_one (uint64 b)
 
static int next_one (uint64 *b, int x)
 
static int count (uint64 b)
 
uint64 get_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)
 
uint64 v_mask (int x)
 
uint64 d7_mask (int x)
 
uint64 d9_mask (int x)
 
uint64 d_mask (int x)
 
uint64 d_add (int x)
 
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 h_flip_index (int x)
 
int v_flip_index (int x)
 
int d7_flip_index (int x)
 
int d_flip_index (int x)
 
int d9_flip_index (int x)
 
int get_flip_count (uint8 l, int x)
 
int count_flip_h (const uint64 P, int x)
 
int count_flip_v (const uint64 P, int x)
 
int count_flip_d7 (const uint64 P, int x)
 
int count_flip_d9 (const uint64 P, int x)
 
int count_flip (const uint64 P, int x)
 
void check (int x)
 
int main ()
 

Variables

const uint64 BIT [64]
 

Macro Definition Documentation

◆ foreach_bits

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

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 
PASS 

Function Documentation

◆ check()

void check ( int  x)

◆ count()

static int count ( uint64  b)
inlinestatic

◆ count_flip()

int count_flip ( const uint64  P,
int  x 
)

◆ count_flip_d7()

int count_flip_d7 ( const uint64  P,
int  x 
)

◆ count_flip_d9()

int count_flip_d9 ( const uint64  P,
int  x 
)

◆ count_flip_h()

int count_flip_h ( const uint64  P,
int  x 
)

◆ count_flip_v()

int count_flip_v ( const uint64  P,
int  x 
)

◆ d7_flip_index()

int d7_flip_index ( int  x)

◆ d7_mask()

uint64 d7_mask ( 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)

◆ d9_to_line()

uint8 d9_to_line ( uint64  b,
int  x 
)

◆ d_add()

uint64 d_add ( int  x)

◆ d_flip_index()

int d_flip_index ( int  x)

◆ d_mask()

uint64 d_mask ( int  x)

◆ d_to_line()

uint8 d_to_line ( uint64  b,
int  x 
)

◆ first_one()

int first_one ( uint64  b)

◆ get_flip_count()

int get_flip_count ( uint8  l,
int  x 
)

◆ get_P()

uint64 get_P ( uint64  mask,
const uint64  flat 
)

◆ h_flip_index()

int h_flip_index ( int  x)

◆ h_mask()

uint64 h_mask ( int  x)

◆ h_to_line()

uint8 h_to_line ( uint64  b,
int  x 
)

◆ main()

int main ( )

◆ next_one()

static int next_one ( uint64 b,
int  x 
)
inlinestatic

◆ 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)

◆ v_to_line()

uint8 v_to_line ( uint64  b,
int  x 
)

Variable Documentation

◆ BIT

const uint64 BIT[64]
Initial value:
= {
0x0000000000000001ULL, 0x0000000000000002ULL, 0x0000000000000004ULL, 0x0000000000000008ULL,
0x0000000000000010ULL, 0x0000000000000020ULL, 0x0000000000000040ULL, 0x0000000000000080ULL,
0x0000000000000100ULL, 0x0000000000000200ULL, 0x0000000000000400ULL, 0x0000000000000800ULL,
0x0000000000001000ULL, 0x0000000000002000ULL, 0x0000000000004000ULL, 0x0000000000008000ULL,
0x0000000000010000ULL, 0x0000000000020000ULL, 0x0000000000040000ULL, 0x0000000000080000ULL,
0x0000000000100000ULL, 0x0000000000200000ULL, 0x0000000000400000ULL, 0x0000000000800000ULL,
0x0000000001000000ULL, 0x0000000002000000ULL, 0x0000000004000000ULL, 0x0000000008000000ULL,
0x0000000010000000ULL, 0x0000000020000000ULL, 0x0000000040000000ULL, 0x0000000080000000ULL,
0x0000000100000000ULL, 0x0000000200000000ULL, 0x0000000400000000ULL, 0x0000000800000000ULL,
0x0000001000000000ULL, 0x0000002000000000ULL, 0x0000004000000000ULL, 0x0000008000000000ULL,
0x0000010000000000ULL, 0x0000020000000000ULL, 0x0000040000000000ULL, 0x0000080000000000ULL,
0x0000100000000000ULL, 0x0000200000000000ULL, 0x0000400000000000ULL, 0x0000800000000000ULL,
0x0001000000000000ULL, 0x0002000000000000ULL, 0x0004000000000000ULL, 0x0008000000000000ULL,
0x0010000000000000ULL, 0x0020000000000000ULL, 0x0040000000000000ULL, 0x0080000000000000ULL,
0x0100000000000000ULL, 0x0200000000000000ULL, 0x0400000000000000ULL, 0x0800000000000000ULL,
0x1000000000000000ULL, 0x2000000000000000ULL, 0x4000000000000000ULL, 0x8000000000000000ULL,
}