Skip to main content

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.

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).

Formally, your function signatures should be as follows:

from typing import Callable, TypeAlias

checkerType: TypeAlias = Callable[[bytes, bytes, bytes, dict], tuple[bool, str]]
activateType: TypeAlias = Callable[[dict], checkerType]

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autohack_next-1.0.11.tar.gz (49.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autohack_next-1.0.11-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file autohack_next-1.0.11.tar.gz.

File metadata

  • Download URL: autohack_next-1.0.11.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for autohack_next-1.0.11.tar.gz
Algorithm Hash digest
SHA256 51c969e427987ff5912c8419a13cdf2091ddcc7d3eca63bc83bcd164e3352ba2
MD5 1c73e42b3acb8ac67313878350036e1c
BLAKE2b-256 a9ba0286b7e63a1196f0cce4b70b372f23f85b418616899d46bde96e0a67c9a1

See more details on using hashes here.

File details

Details for the file autohack_next-1.0.11-py3-none-any.whl.

File metadata

  • Download URL: autohack_next-1.0.11-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for autohack_next-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 258ecd82c7e135c391e556b92180d009c070736d024c9279b76c2dab5d924bfd
MD5 b0e5a3392981b347df14ed67934efc3c
BLAKE2b-256 f41040675746e4b966c0d39f053891a7c718c6934d21142b11dd40ab2f41d6d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page