I did this years ago with Futhark.

In 2.55,b it is much sinpler.