Grid-based robot programming environment and judge helpers for Jungol-style Python problems.
Project description
robot-jungol
robot-jungol is a small Python package for Jungol-style robot programming problems. It provides a grid-world robot API, Pillow-based rendering, action logs, and helpers that judge runners can use to capture and replay submitted robot actions.
The distribution name is robot-jungol. The primary import package is jungol_robot, and the package also keeps Jungol-compatible top-level modules such as robot and robot_judge.
Installation
Install from GitHub:
python -m pip install git+https://github.com/hancomac/robot-jungol.git
For local development:
python -m pip install -e ".[dev]"
Quick Start
The top-level robot module is the compatibility entry point used by existing judge environments:
from robot import Beeper, Robot, Wall, World
world = World(width=5, height=5, walls=[Wall((1, 0), (2, 0))])
world.add_piece(Beeper(position=(2, 2)))
robot = Robot(position=(0, 0), direction="R", beepers=1)
world.add_piece(robot)
robot.set_trace("red")
robot.move()
robot.turn_left()
robot.drop_beeper()
You can also import the package API directly:
from jungol_robot import Robot, World
Judge Helpers
robot_judge runs a submitted Python file, captures logged robot actions, and emits a machine-readable line prefixed with __ROBOTLOG__.
from robot_judge import extract_actions_from_output, run_robot_judge, simulate_robot
run_robot_judge(path="User.py")
actions = extract_actions_from_output(output_text)
final_x, final_y, final_direction = simulate_robot(actions)
If a saved world should be loaded when World() is created, pass world_file or world_path to run_robot_judge. This sets the ROBOT_WORLD_SAVE environment variable for the duration of the run.
Image Output
Interactive robot actions can emit image payloads for judge UIs. Set IMG_OUT_DIR to a writable directory to produce images.jsonl and per-frame JSON files.
Supported environment variables:
IMG_OUT_DIR: output directory for image JSON payloadsIMG_MAX_WIDTH: maximum emitted image width, default1280IMG_MAX_HEIGHT: maximum emitted image height, default720IMG_WEBP_QUALITY: WebP output quality, default85
Development
Run the test suite with the standard library test runner:
python -m unittest discover -s tests
Build source and wheel distributions:
python -m build
License
MIT. Portions are derived from the urobot project.
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 robot_jungol-0.1.0.tar.gz.
File metadata
- Download URL: robot_jungol-0.1.0.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4954ee7322fe3fedea57f65cc605d9f8e6b86d2d03e395c2eb1398b39ba94e4d
|
|
| MD5 |
4e00c0b1bb45cbe3eb3de756d33ea199
|
|
| BLAKE2b-256 |
003499754d5cf41293841fc651e89fd9bedfac1dc7d5b6cd82fefd6fcc128006
|
Provenance
The following attestation bundles were made for robot_jungol-0.1.0.tar.gz:
Publisher:
publish.yml on HancomAC/robot-jungol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
robot_jungol-0.1.0.tar.gz -
Subject digest:
4954ee7322fe3fedea57f65cc605d9f8e6b86d2d03e395c2eb1398b39ba94e4d - Sigstore transparency entry: 1921827355
- Sigstore integration time:
-
Permalink:
HancomAC/robot-jungol@0d11abfdc6255e0aad8016cd55677057c05c2cae -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HancomAC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d11abfdc6255e0aad8016cd55677057c05c2cae -
Trigger Event:
push
-
Statement type:
File details
Details for the file robot_jungol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: robot_jungol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b97ffec043a1bdcd7925995675ac4e849bb77ae7a5bb018a20f6a6c000259025
|
|
| MD5 |
aa00274e0833d3363d61b17fb835588b
|
|
| BLAKE2b-256 |
e940e1923ea60810a4d8c973d385ec52b7e3c1ebf9c9474fc5035d8ba73c06b5
|
Provenance
The following attestation bundles were made for robot_jungol-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on HancomAC/robot-jungol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
robot_jungol-0.1.0-py3-none-any.whl -
Subject digest:
b97ffec043a1bdcd7925995675ac4e849bb77ae7a5bb018a20f6a6c000259025 - Sigstore transparency entry: 1921827476
- Sigstore integration time:
-
Permalink:
HancomAC/robot-jungol@0d11abfdc6255e0aad8016cd55677057c05c2cae -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HancomAC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d11abfdc6255e0aad8016cd55677057c05c2cae -
Trigger Event:
push
-
Statement type: