Mahjong MPSZ Rendering

I've written a fun script to render out tiles using mpsz notation & a library of public domain SVGs.

It takes the following plain text: 119p 19s 19m 1234567z
Then renders out the following:

119p 19s 19m 1234567z

Currently, it just parses my markdown files on my site and renders out the tiles at runtime, but I'll eventually make it an NPM package if I get around to it.

Interactive demo

Update the input below to view your hand. Use MPSZ notation.

If you have Javascript enabled, the demo should render here.

Code Sandbox

I've put a small amount of the code into a sandbox for you to poke around with. I actually discovered a few bugs with my sandbox implementation, so I'll eventually need to fix those... This code is in plain JS and not Typescript - which the main implementation is. Another limitation of my sandbox sadly.