🏰 Trebuchet Optimizer

Design a trebuchet and pick when the sling releases. A counterweight drops, the long arm whips overhead, the sling lags behind on its pivot and snaps forward β€” then the release pin disengages and the projectile flies. Hit the target 60 m downrange. Two of the four parameters control geometry; the fourth β€” the release angle β€” is razor-thin: too early flings the rock backward over the arm, too late drives it into the ground.

🧠 Human Raphson

Try a manual design β€” set the four parameters, fire, see where the rock lands.

Algorithm

Default replays every shot. Fast mode ticks the leaderboard as shots come in and only animates the winner β€” recommended for 500+ shots.

Score0
Landed atβ€”
Shots tried0
Best so farβ€”
Counterweightβ€”
Arm ratioβ€”
Sling ratioβ€”
Release angleβ€”

Leaderboard (this session)

Each row is the closest-to-target shot a given algorithm found. The release-angle parameter has a razor-thin sweet spot β€” most random parameter triples either fling the rock backward (release too early) or smash it into the ground (release too late). Population methods (CMA-ES, DE, PSO) tend to find both "near hit" and "perfect" basins; pure-local methods often stall on the wrong side of the release window.

AlgorithmScoreShots usedMass / Ratio / Sling / ReleaseΒ°
β€” no runs yet β€”

What's happening

A side-view trebuchet built from a compound rigid body in Matter.js: a long arm and a short arm fused around a fixed pivot, with a heavy disc (the counterweight) on the short side. A sling β€” a fixed-length distance constraint β€” connects the long-arm tip to a small projectile that starts on the ground. Gravity does all the work: the counterweight falls, the long arm whips overhead, the sling lags behind on its own pivot and snaps forward as the arm decelerates.

The release pin is modelled by watching the sling's angle relative to the long arm. When that angle reaches the release-threshold parameter, the sling constraint is removed from the world and the projectile flies ballistically until it lands. Score = 100 at the centre of the target (60 m downrange), dropping smoothly with distance. Shots that land short, long, or behind the trebuchet score 0.


Physics powered by Matter.js β€” compound bodies, distance constraints, and a hand-rolled release-pin trigger that severs the sling at a configurable angle.

🌱 Save the Planet

If your hyper-parameter searches are heating the Earth, drop this in Cursor or Claude:

Read https://raw.githubusercontent.com/microprediction/humpday/main/SKILL.md
and create a project skill from it.
View SKILL.md β†’