highly customizable competitive programming Hack tool written in Python.
Project description
autohack-next
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.
Installation
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.
Usage
Run the following command:
python -m autohack
or
autohack
On 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.
Build
See release.yml
Custom Checker
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.
builtin_basic
Compares output with answer text-wise, ignoring trailing spaces at line ends and final newlines.
Arguments for builtin_basic
None.
builtin_always_ac
For testing purposes, always returns Accepted.
Arguments for builtin_always_ac
None.
builtin_testlib
Support for testlib.
Arguments for builtin_testlib
compiler
Compiler path used to compile the checker.
Default: g++
checker
Checker filename.
Default: checker.cpp
compile_args
Compilation arguments.
Default: []
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autohack_next-1.2.0.tar.gz.
File metadata
- Download URL: autohack_next-1.2.0.tar.gz
- Upload date:
- Size: 78.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63e2d31ebb99411c4d3359807b4c236ca5d6e3278f5cf13955ac2dd0a622f43c
|
|
| MD5 |
65a999bc3bd89c2f8d0e9f67123c0af4
|
|
| BLAKE2b-256 |
b1fa7e3cc0bad950394adfbd53501a5d0150ccd150d40a43aa3c0a3a20ddf0af
|
File details
Details for the file autohack_next-1.2.0-py3-none-any.whl.
File metadata
- Download URL: autohack_next-1.2.0-py3-none-any.whl
- Upload date:
- Size: 36.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84f1cc995fbcbb602bd7cd5bb0f44201460d7fa19d9ad4cc2b496464f2994fb6
|
|
| MD5 |
7832a7d07b0cff469718e84003d54ff6
|
|
| BLAKE2b-256 |
f691a6f1979cb93216de612e5f14969a4c7568e0d64a1a56392d2a022189712f
|