Skip to content

Instantly share code, notes, and snippets.

View ianfab's full-sized avatar

Fabian Fichter ianfab

  • Heidelberg, Germany
  • 00:58 (UTC +01:00)
View GitHub Profile
@ianfab
ianfab / bench-parallel.sh
Created March 14, 2017 18:29
bench script
#!/bin/bash
if [[ $# -ne 3 ]]; then
echo "usage:" $0 "base test n_runs"
echo "example:" $0 "./stockfish_base ./stockfish_test 10"
exit 1
fi
base=$1
test=$2
n_runs=$3
@ianfab
ianfab / atomic960.py
Last active July 3, 2018 18:52
Analyze chess960 starting positions for chess or chess variants.
import argparse
import csv
import chess, chess.variant, chess.uci
def parse_args():
parser = argparse.ArgumentParser(description='Evaluate atomic960 positions.')
parser.add_argument('-e', '--engine', required=True, help='Path to engine.')
parser.add_argument('-o', '--output', required=True, help='Output csv file.')
parser.add_argument('-d', '--depth', type=int, default=10, help='Search depth.')
@ianfab
ianfab / analysis.py
Last active June 16, 2018 08:11
Analyze chess (variant) positions from an EPD file
import argparse
import logging
import chess, chess.variant, chess.uci
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def parse_args():
K_FACTORS = (
(720, 40),
(1040, 36),
(1280, 32),
(1560, 28),
(1920, 24),
(2240, 20),
(9999, 16),
)
@ianfab
ianfab / pgn4_to_pgn.py
Last active February 25, 2024 23:42
PGN4 to PGN conversion
import argparse
import os
import re
import sys
import pyffish
SEIRAWAN_CASTLING = {'O-O': 'O-O', 'O-O-O': 'O-O-O', 'h1-e1': 'O-O', 'h8-e8': 'O-O', 'a1-e1': 'O-O-O', 'a8-e8': 'O-O-O'}