Is the source code available at somewhere? I'm curious about how this can be done with puzzlescript.
Hackable version:https://www.puzzlescript.net/play.html?p=031d04d3e843406814ce59d2e58babc8