Actually, probably it would not be so difficult. Store a collection of objects that represent characters with their properties, such as TL, BR, T, BL (upper left, lower right, upper, lower left), for example:
a = RunKey.get("A"); public class RunKey{ public static Key get(Character char){ switch(char){ case A,a: return new A(); break;
I began to go crazy creating the “Direction” interface, so it’s a bit more complicated than at the beginning, but you only have so many complications and relatively simple objects, so if you save it, it will probably remain pretty fast.
I feel like a dynamic language might be the best for something like that ...
And yes, as other answers note, regex won't work.
source share