Skip to content
/ surge Public

A fast bitboard-based chess move generator in C++

License

Notifications You must be signed in to change notification settings

nkarve/surge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

surge

A fast bitboard-based legal chess move generator, written in C++

Features:

  • Magic Bitboard sliding attacks and pre-generated attack tables
  • Make-Unmake position class
  • 16-bit Move representation
  • Extremely fast bulk-counted perft (over 180,000,000 NPS, single-threaded, without hashtable)
  • Simple design for use in any chess engine

perft(6) from starting position:

perft(6)

Getting Started:

#include "position.h"
#include "tables.h"
#include "types.h"

int main() {
    initialise_all_databases();
    zobrist::initialise_zobrist_keys();
	
    Position p;
    Position::set("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -", p);
    std::cout << p; 
  
    MoveList<WHITE> list(p)
  
    for(Move m : list) {
        std::cout << m << "\n";
    }
    
    return 0;
}

About

A fast bitboard-based chess move generator in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages