Skip to content

Instantly share code, notes, and snippets.

import { CourseHelpers } from '../CourseData';
import { Strategy, Aptitude } from '../HorseTypes';
import { Region } from '../Region';
import { Rule30CARng } from '../Random';
import { RaceSolver, SkillType, SkillRarity } from '../RaceSolver';
const base = {
speed: 1400,
stamina: 800,
power: 1000,
/**
* Use the PEXT instruction and perfect hash functions to store small integer maps
* inside a uint64_t (or smaller).
*
* Compile with `-Wno-multichar -mbmi2 -mlzcnt` (or -march=native on any recent x86 CPU).
*
* Modify `tbl` below to change the map.
*
* If it takes a long time and doesn't find a solution, fiddle with the hash function (`h`).
*
const enum Strategy { Nige, Senkou, Sasi, Oikomi, Oonige }
const enum Surface { Turf, Dirt }
const enum Aptitude { S, A, B, C, D, E, F, G }
type Phase = 0 | 1 | 2;
interface HorseParameters {
speed: number
stamina: number
power: number
import { CourseHelpers } from '../CourseData';
import { Strategy, Aptitude } from '../HorseTypes';
import { RaceSolver } from '../RaceSolver';
import { RaceSolverBuilder } from '../RaceSolverBuilder';
import courses from '../data/course_data.json';
import tracknames from '../data/tracknames.json';
const G1TRACKS = ['11101', '10504', '10506', '10501', '11503', '11401', '11403', '10804', '11402', '10906', '11301', '10606', '11501', '10903', '10602', '10708', '11303', '10611', '10701', '11504', '10811', '10810', '11302', '10604', '10905', '11102', '10808', '11103', '10807', '11502'];