Skip to main content

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.

Robot world screenshot

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 payloads
  • IMG_MAX_WIDTH: maximum emitted image width, default 1280
  • IMG_MAX_HEIGHT: maximum emitted image height, default 720
  • IMG_WEBP_QUALITY: WebP output quality, default 85

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


Download files

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

Source Distribution

robot_jungol-0.1.0.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

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

robot_jungol-0.1.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

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

Hashes for robot_jungol-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4954ee7322fe3fedea57f65cc605d9f8e6b86d2d03e395c2eb1398b39ba94e4d
MD5 4e00c0b1bb45cbe3eb3de756d33ea199
BLAKE2b-256 003499754d5cf41293841fc651e89fd9bedfac1dc7d5b6cd82fefd6fcc128006

See more details on using hashes here.

Provenance

The following attestation bundles were made for robot_jungol-0.1.0.tar.gz:

Publisher: publish.yml on HancomAC/robot-jungol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for robot_jungol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b97ffec043a1bdcd7925995675ac4e849bb77ae7a5bb018a20f6a6c000259025
MD5 aa00274e0833d3363d61b17fb835588b
BLAKE2b-256 e940e1923ea60810a4d8c973d385ec52b7e3c1ebf9c9474fc5035d8ba73c06b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for robot_jungol-0.1.0-py3-none-any.whl:

Publisher: publish.yml on HancomAC/robot-jungol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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