///|
/// A five layer box pyramid that settles and then goes to sleep.
///
/// ```bash
/// moon run examples/pyramid
/// ```
///
/// Kinetic energy is the honest progress bar of a rigid body solver: it has to
/// fall to near zero, and the `asleep` count shows the engine noticing that by
/// itself and switching the pile off.
///
/// Six layers and above is where a ten iteration sequential impulse solver
/// starts to hum: the pile keeps a few centimetres per second of residual speed
/// instead of settling. Raise the iterations if you need taller piles.
fn main {
let layers = 5
let world = @moonphys.World::builder().ground(30.0).build()
for layer in 0..[^<>]+?)"\>(?[^\/<>]+?)\<\/a\>/g
},
hljs.COMMENT(
'//', // begin
'\n', // end
)
]
}
}
hljs.registerLanguage('moonbit', moonbitLanguageFn);
hljs.highlightAll();
hljs.initLineNumbersOnLoad();
const number = window.location.href.split('#')[1];
function waitForLineNumbers() {
setTimeout(function () {
const target = document.querySelector(`.hljs-ln-line[data-line-number="${number}"]`);
if (target == null) waitForLineNumbers();
else target.scrollIntoView();
}, 50);
}
waitForLineNumbers()