Skip to content

Instantly share code, notes, and snippets.

View AndyGrant's full-sized avatar

Andrew Grant AndyGrant

View GitHub Profile
#!/bin/python3
import argparse
import chess
import chess.pgn
import chess.syzygy
import io
import multiprocessing
import numpy as np
import sys
#!/bin/python3
import argparse
import chess
import chess.pgn
from subprocess import Popen, PIPE, call
from multiprocessing import Process, Queue
class Engine():
#!/bin/python3
import os
from itertools import combinations_with_replacement
def tablebase_names(K=6):
letters = ['', 'Q', 'R', 'B', 'N', 'P']
# Generate many potential K[] v K[], including all valid ones
@AndyGrant
AndyGrant / sim.py
Last active January 25, 2023 11:59
from random import uniform
from concurrent.futures import ThreadPoolExecutor
ITERATIONS = 1000 # Number of times to run the simulation, to reduce variance
LENGTH = 300 * 1000 # Fight is 300 seconds, or 300,000 milliseconds
AA_SPEED = LENGTH / 154.0 # We just compute your in-practice AA-speed, based on the first sim
BASE_CD = 45 * 1000 # This is the CD of Wake of ashes. We assume at-least 1 cast per 45s
INITIAL_CAST = 5.875 * 1000 # According to your first sim, you do not press Wake until this time
PROC_RATE = 0.042 # This is the probability of getting a Wake proc on an auto attack
#include <argp.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>