Skip to content

Comment on Super Mario Derivations

Comments

This is such a cool and funny use of derivations. He defines a Nix attribute path that emulates game state in Super Mario 3 so that you can say

    nix build '.#level1.rightb.rightb.rightab.rightb'
And it outputs the screenshot that results in that sequence of button presses. And shared prefixes cache to the same hash, so Nix caches every step so that you can try different button sequences and only have to calculate from the point that you've reached a unique sequence.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.