OK I need a smarter way to encode the maze in #FingerMaze because the approach I'm using can't handle huge mazes (for example a 160×90 maze will result in a 414 Request URI Too Long error.)
I guess switching to fragment for ID would work until I can think of a simple way to compress these things in a smart way.
One of the issues is that the encoding I'm using is extremely verbose. I discuss some of the details here https://dropthemath.oblomov.eu/fm/finger-maze.md.html but basically: each square in the maze can be represented by 4 bits, one for each side, that tells you if it's open or closed. There are 16 possible tiles, and a letter mnemonic is associated with each. The “id” of a maze is basically a sequence of these mnemonics, plus some metadata (number of rows and columns, and the entry/exit cells).
This kind of encoding allows for nonsensical mazes (there's an example in the document above), but also some interesting features such as one-way doors that are technically supported by the implementation, but never generated by the code (and are not represented properly in the graphics either). Even if we allow all of these features, though, the thing remains that we could pack two tiles in a single byte, while the ID currently uses one byte per tile.
Of course to keep the ID textual one would need to do something like base64-encode the bytes that represent pairs of tiles, and since base64 encodes 3 bytes in 4 characters, we'd get 6 tiles per 4 characters (or rather 3 tiles per 2 characters). That's still not enough (the 160×90 maze would drop from 14400 bytes to 9600 bytes —still too much).
@oblomov
Is compressing is an option? Otherwise, you need to change representation.
@glipari gzip is not enough. The famous 160×90 maze drops from 14400 characters to 5944 bytes if gzipped, that grow to 80333 after base64 encoding. bzip2 does a much better job (5083/6870), but it's still more than can be used in an URI.
@glipari (and of course I would have to implement compression/decompression in JS, or load JS libraries that do that).