AgentnessBench / proteus /game /engine /__init__.py
irregular6612's picture
refactor: restructure proteus into game/web subpackages
426093b
Raw
History Blame Contribute Delete
1.85 kB
"""arc_grid — the ARC-AGI 64x64 grid system, extracted as a standalone package.
Bundles two pieces:
* ``arc_grid.arcengine`` — the grid/sprite engine (vendored from arcprize/ARCEngine).
64x64 grid, 16-color palette, Sprite / Camera / Level / ARCBaseGame, collisions.
External deps: numpy, pydantic.
* ``arc_grid.rendering`` — the visualization layer (palette + frame -> RGB / terminal).
External deps: numpy (always), matplotlib (only for the animated display helpers).
Quick start::
import numpy as np
from arc_grid import frame_to_rgb_array, COLOR_MAP
from arc_grid import Sprite, Camera
frame = np.zeros((64, 64), dtype=np.int8) # a blank 64x64 grid
rgb = frame_to_rgb_array(0, frame, scale=4) # -> (256, 256, 3) uint8
See README.md for details and attribution.
"""
# Engine surface (re-exported from the vendored arcengine package)
from .arcengine import (
ARCBaseGame,
ActionInput,
BlockingMode,
Camera,
ComplexAction,
FrameData,
FrameDataRaw,
GameAction,
GameState,
InteractionMode,
Level,
PlaceableArea,
RenderableUserDisplay,
SimpleAction,
Sprite,
ToggleableUserDisplay,
)
# Rendering surface
from .rendering import (
COLOR_MAP,
frame_to_rgb_array,
hex_to_rgb,
render_frames,
render_frames_terminal,
rgb_to_ansi,
)
__all__ = [
# engine
"ARCBaseGame",
"ActionInput",
"BlockingMode",
"Camera",
"ComplexAction",
"FrameData",
"FrameDataRaw",
"GameAction",
"GameState",
"InteractionMode",
"Level",
"PlaceableArea",
"RenderableUserDisplay",
"SimpleAction",
"Sprite",
"ToggleableUserDisplay",
# rendering
"COLOR_MAP",
"frame_to_rgb_array",
"hex_to_rgb",
"render_frames",
"render_frames_terminal",
"rgb_to_ansi",
]