English | 简体中文
A highly customizable competitive programming Hack tool written in Python.
A completely refactored version of autohack with clearer configuration, a redesigned interface, and more powerful performance.
autohack-next is published as a package on PyPI. Install it using a Python package manager, or you can download pre-built binary files to run. Development (pre-release) versions are published to TestPyPI.
Run the following command:
python -m autohackor
autohackOn the first run, it will generate a .autohack folder in the current directory and exit.
After adjusting the settings in .autohack/config.json, run it again to start using.
See release.yml
You can use custom checkers in the checker.name configuration option.
autohack-next will read files named {checker.name}.py from the .autohack/checkers folder.
Custom checker files need an activate function that receives the argument list (i.e., the checker.args configuration option) and returns a checker function.
The checker function needs to accept input, output, answer, and argument list, and return a tuple. The tuple contains a boolean value (true when Accepted) and a string (the checker output).
Optionally, a custom checker may also provide a deactivate function which accepts the same checker.args dictionary and returns None; this can be used for cleanup or post-processing.
Formally, your function signatures should be as follows:
# autohack/core/checker.py
from typing import Callable, TypeAlias
checkerType: TypeAlias = Callable[[bytes, bytes, bytes, dict], tuple[bool, str]]
activateType: TypeAlias = Callable[[dict], checkerType]
deactivateType: TypeAlias = Callable[[dict], None]There are several built-in checkers available.
Compares output with answer text-wise, ignoring trailing spaces at line ends and final newlines.
None.
For testing purposes, always returns Accepted.
None.
Support for testlib.
Compiler path used to compile the checker.
Default: g++
Checker filename.
Default: checker.cpp
Compilation arguments.
Default: []