Skip to main content

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: []

Metadata

Release files for autohack-next 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autohack-next 1.2.0
File Size Uploaded Provenance
autohack_next-1.2.0.tar.gz 78.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for autohack-next 1.2.0
File Interpreter ABI Platform
autohack_next-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.8 kB

Release files / autohack_next-1.2.0.tar.gz

Download URL autohack_next-1.2.0.tar.gz
Size 78.2 kB
Tags Source
SHA-256 checksum
How to use checksums
63e2d31ebb99411c4d3359807b4c236ca5d6e3278f5cf13955ac2dd0a622f43c
BLAKE2b-256 checksum
How to use checksums
b1fa7e3cc0bad950394adfbd53501a5d0150ccd150d40a43aa3c0a3a20ddf0af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / autohack_next-1.2.0-py3-none-any.whl

Download URL autohack_next-1.2.0-py3-none-any.whl
Size 36.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84f1cc995fbcbb602bd7cd5bb0f44201460d7fa19d9ad4cc2b496464f2994fb6
BLAKE2b-256 checksum
How to use checksums
f691a6f1979cb93216de612e5f14969a4c7568e0d64a1a56392d2a022189712f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for autohack-next 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page