skills/tabular/rectangular-flight-plan-encoding/SKILL.md
Encode closed rectangular patrol routes as compact direction-distance strings for fleet pathfinding on toroidal game grids
npx skillsauth add wenmin-wu/ds-skills tabular-rectangular-flight-plan-encodingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
In grid-based game AI competitions, units follow flight plans encoded as strings of direction characters and distances (e.g., "N3E3S3W"). A rectangular route visits the perimeter of a box and returns to the origin, maximizing cells visited for resource collection. The plan length is constrained by unit count (floor(2 * ln(ships)) + 1), linking fleet size to patrol range.
from kaggle_environments.envs.kore_fleets.helpers import Direction
def build_rect_plan(start_dir_idx, side_length):
plan = ""
for i in range(4):
plan += Direction.from_index((start_dir_idx + i) % 4).to_char()
if i < 3:
plan += str(side_length)
return plan
# "N5E5S5W" — a 5x5 rectangle starting north, returns to origin
plan = build_rect_plan(0, 5)
# Minimum ships needed: exp((len(plan) - 1) / 2) ≈ 21 for a 9x9 box
floor(2 * ln(ships)) + 1 character limitln(ships)/20 per cell — many small fleets extract more than one large fleetdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF