codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <stdio.h> #include <stdint.h> typedef uint64_t bboard; // Accessing a square of the bitboard bboard get (bboard b, int square) { return (b & (1ULL << square)); } void print_board (bboard b) { int i, j, square; for (i = 7; i >= 0; i--) // rank => top to bottom { for (j = 0; j < 8; j++) // file => left to right printf ("%d ", get (b, j+8*i) ? 1 : 0); printf ("\n"); } } int main () { bboard b = 0xffffffffffffffffLL; print_board (b); }
Private
[
?
]
Run code
Submit