In the location-based AR mobile game way of life Ingress the player can hack things called portals in order to get items. (If you are interested in Ingress, you can ping me in chat for more info. Trust me, it's better than Pokémon. If you end up downloading it, remember to choose the Resistance.)
A way to increase hack output significantly is the glyph hacking minigame, in which the player has to draw glyphs on a hexagonal grid.
In total, there are about 115 glyphs with about 130 names that are actually used in the game.
Glyphs
For the purposes of this challenge we will number each point of the grid like so:
Here is the list of all the glyphs for the purposes of this challenge. The list is a JSON object, containing each glyph as a list of edges.
{
"ABANDON": [[1, 6], [3, 4], [4, 8], [6, 10], [8, 10]],
"ACCEPT": [[3, 7], [3, 8], [7, 8]],
"ADVANCE": [[0, 9], [4, 9]],
"AFTER": [[1, 2], [1, 6], [2, 7], [6, 10], [7, 10]],
"AGAIN": [[4, 9], [6, 7], [6, 10], [8, 9], [8, 10]],
"ALL": [[0, 1], [0, 5], [1, 2], [2, 3], [3, 4], [4, 5]],
"ANSWER": [[6, 7], [6, 9], [7, 10]],
"ATTACK": [[0, 6], [0, 9], [2, 6], [4, 9]],
"AVOID": [[0, 5], [0, 6], [1, 6], [1, 7]],
"BALANCE": [[0, 10], [2, 3], [2, 7], [3, 4], [4, 8], [7, 10], [8, 10]],
"BARRIER": [[0, 10], [2, 7], [7, 10]],
"BEFORE": [[4, 5], [4, 8], [5, 9], [8, 10], [9, 10]],
"BEGIN": [[0, 8], [3, 7], [3, 8]],
"BODY": [[6, 9], [6, 10], [9, 10]],
"BREATHE": [[1, 6], [5, 9], [6, 10], [9, 10]],
"CAPTURE": [[1, 7], [3, 4], [4, 8], [7, 10], [8, 10]],
"CHANGE": [[3, 7], [3, 10], [8, 10]],
"CHAOS": [[0, 1], [0, 5], [1, 6], [3, 8], [4, 5], [6, 10], [8, 10]],
"CIVILIZATION": [[1, 6], [5, 9], [6, 7], [7, 8], [8, 9]],
"CLEAR": [[0, 10], [3, 10]],
"CLEAR ALL": [[0, 1], [0, 5], [0, 10], [1, 2], [2, 3], [3, 4], [3, 10], [4, 5]],
"COMPLEX": [[6, 9], [8, 10], [9, 10]],
"CONFLICT": [[2, 6], [4, 9], [6, 7], [7, 8], [8, 9]],
"CONTEMPLATE": [[0, 1], [1, 2], [2, 3], [3, 8], [6, 10], [8, 9], [9, 10]],
"COURAGE": [[4, 9], [7, 8], [8, 9]],
"CREATE": [[1, 6], [4, 8], [6, 10], [8, 10]],
"DANGER": [[0, 9], [3, 10], [9, 10]],
"DATA": [[0, 6], [3, 8], [6, 10], [8, 10]],
"DEFEND": [[1, 7], [3, 7], [3, 8], [5, 8]],
"DESTINY": [[3, 8], [6, 7], [6, 10], [7, 8], [9, 10]],
"DESTROY": [[2, 7], [5, 9], [7, 10], [9, 10]],
"DETERIORATE": [[4, 8], [8, 10], [9, 10]],
"DIE": [[2, 7], [4, 8], [7, 10], [8, 10]],
"DIFFICULT": [[1, 6], [6, 7], [7, 10], [8, 10]],
"DISCOVER": [[1, 2], [2, 3], [3, 4]],
"DISTANCE": [[0, 5], [4, 5]],
"EASY": [[3, 8], [6, 10], [8, 10]],
"END": [[0, 1], [0, 10], [1, 7], [3, 7], [3, 10]],
"ENLIGHTENED": [[0, 1], [0, 9], [1, 2], [2, 3], [6, 9], [6, 10], [9, 10]],
"ENLIGHTENMENT": [[0, 1], [0, 9], [1, 2], [2, 3], [6, 9], [6, 10], [9, 10]],
"EQUAL": [[6, 7], [6, 9], [8, 9]],
"ESCAPE": [[0, 1], [1, 6], [6, 9], [8, 9]],
"EVOLUTION": [[0, 10], [8, 9], [9, 10]],
"FAILURE": [[0, 10], [6, 7], [6, 10]],
"FEAR": [[1, 7], [6, 7], [6, 9]],
"FOLLOW": [[0, 6], [1, 2], [1, 6]],
"FORGET": [[4, 8]],
"FUTURE": [[1, 6], [2, 7], [6, 7]],
"GAIN": [[5, 8]],
"GROW": [[4, 9], [8, 9]],
"HARM": [[0, 6], [0, 9], [2, 7], [6, 10], [7, 10], [9, 10]],
"HARMONY": [[0, 6], [0, 9], [3, 7], [3, 8], [6, 10], [7, 10], [8, 10], [9, 10]],
"HAVE": [[3, 8], [7, 10], [8, 10]],
"HELP": [[5, 9], [7, 8], [8, 10], [9, 10]],
"HIDE": [[1, 6], [1, 7], [6, 9], [7, 8]],
"HUMAN": [[3, 7], [3, 8], [6, 7], [6, 9], [8, 9]],
"IDEA": [[1, 2], [1, 6], [2, 7], [4, 5], [4, 8], [5, 9], [7, 10], [9, 10]],
"IGNORE": [[2, 7]],
"IMPERFECT": [[6, 8], [6, 10], [8, 9], [8, 10], [9, 10]],
"IMPROVE": [[1, 6], [6, 10], [7, 10]],
"IMPURE": [[3, 10], [8, 9], [8, 10], [9, 10]],
"INSIDE": [[6, 7], [6, 9]],
"INTELLIGENCE": [[1, 6], [4, 8], [6, 10], [8, 9], [9, 10]],
"INTERRUPT": [[0, 10], [3, 10], [4, 5], [4, 8], [5, 9], [8, 10], [9, 10]],
"JOURNEY": [[1, 6], [2, 3], [3, 4], [4, 5], [5, 9], [6, 10], [9, 10]],
"KNOWLEDGE": [[3, 6], [3, 9], [6, 10], [9, 10]],
"LEAD": [[0, 5], [3, 8], [4, 5], [4, 8]],
"LEGACY": [[0, 1], [0, 5], [1, 6], [2, 7], [4, 8], [5, 9], [6, 7], [8, 9]],
"LESS": [[6, 10], [9, 10]],
"LIBERATE": [[0, 1], [1, 6], [4, 9], [6, 10], [9, 10]],
"LIE": [[6, 7], [6, 10], [7, 10], [8, 9], [9, 10]],
"LOSE": [[1, 7]],
"MESSAGE": [[1, 7], [4, 9], [7, 10], [9, 10]],
"MIND": [[3, 8], [3, 10], [8, 9], [9, 10]],
"MORE": [[7, 10], [8, 10]],
"MYSTERY": [[0, 6], [0, 9], [5, 9], [6, 9], [8, 9]],
"N'ZEER": [[0, 6], [0, 9], [0, 10], [3, 10], [6, 10], [9, 10]],
"NATURE": [[2, 7], [4, 8], [6, 7], [6, 9], [8, 9]],
"NEW": [[2, 7], [6, 7]],
"NO": [[6, 7], [6, 9]],
"NOT": [[6, 7], [6, 9]],
"NOURISH": [[3, 4], [3, 10], [4, 8], [8, 10]],
"NOW": [[6, 7], [7, 8], [8, 9]],
"OLD": [[5, 9], [8, 9]],
"OPEN": [[3, 7], [3, 8], [7, 8]],
"OPEN ALL": [[0, 1], [0, 5], [1, 2], [2, 3], [3, 4], [3, 7], [3, 8], [4, 5], [7, 8]],
"OUTSIDE": [[0, 5], [4, 5]],
"PAST": [[4, 8], [5, 9], [8, 9]],
"PATH": [[0, 10], [4, 8], [8, 10]],
"PEACE": [[0, 6], [0, 9], [3, 7], [3, 8], [6, 10], [7, 10], [8, 10], [9, 10]],
"PERFECTION": [[0, 10], [2, 3], [2, 7], [3, 4], [4, 8], [7, 10], [8, 10]],
"PERSPECTIVE": [[0, 6], [0, 9], [2, 7], [4, 8], [6, 10], [7, 10], [8, 10], [9, 10]],
"PORTAL": [[1, 2], [1, 6], [2, 7], [4, 5], [4, 8], [5, 9], [6, 9], [7, 8]],
"POTENTIAL": [[0, 10], [1, 2], [2, 7], [7, 10]],
"PRESENT": [[6, 7], [7, 8], [8, 9]],
"PURE": [[0, 10], [6, 7], [6, 10], [7, 10]],
"PURSUE": [[0, 6], [0, 9], [5, 9]],
"QUESTION": [[0, 6], [6, 9], [8, 9]],
"REACT": [[2, 7], [6, 9], [7, 10], [9, 10]],
"REBEL": [[1, 2], [1, 6], [5, 8], [6, 10], [8, 10]],
"RECHARGE": [[0, 5], [0, 10], [5, 9], [9, 10]],
"REPAIR": [[0, 5], [0, 10], [5, 9], [9, 10]],
"REPEAT": [[4, 9], [6, 7], [6, 10], [8, 9], [8, 10]],
"RESISTANCE": [[0, 9], [0, 10], [3, 8], [3, 10], [6, 9]],
"RESTRAINT": [[2, 3], [2, 7], [5, 9], [7, 10], [9, 10]],
"RETREAT": [[0, 6], [2, 6]],
"SAFETY": [[2, 6], [4, 9], [6, 9]],
"SAVE": [[1, 7], [7, 10], [8, 10]],
"SEARCH": [[6, 9], [6, 10], [7, 8], [8, 9]],
"SEE": [[0, 9]],
"SEPARATE": [[2, 7], [5, 9], [6, 7], [6, 10], [8, 9], [8, 10]],
"SHAPER": [[0, 6], [0, 9], [2, 7], [4, 8], [6, 7], [8, 9]],
"SIMPLE": [[7, 8]],
"SOUL": [[3, 7], [3, 10], [6, 7], [6, 10]],
"STABILITY": [[2, 7], [4, 8], [7, 8]],
"STAY": [[2, 7], [4, 8], [7, 8]],
"STRONG": [[6, 7], [6, 9], [7, 8], [8, 9]],
"STRUGGLE": [[0, 9], [0, 10], [3, 8], [3, 10], [6, 9]],
"SUCCESS": [[0, 10], [8, 9], [9, 10]],
"TECHNOLOGY": [[1, 6], [2, 7], [6, 10], [7, 10], [8, 9], [8, 10], [9, 10]],
"THOUGHT": [[1, 2], [1, 6], [2, 7], [4, 5], [4, 8], [5, 9], [7, 10], [9, 10]],
"TOGETHER": [[4, 8], [6, 9], [6, 10], [8, 10], [9, 10]],
"TRUTH": [[6, 7], [6, 10], [7, 10], [8, 9], [8, 10], [9, 10]],
"UNBOUNDED": [[0, 1], [0, 5], [1, 7], [2, 3], [3, 4], [4, 5], [6, 9], [6, 10], [7, 8], [8, 9]],
"US": [[3, 6], [6, 9]],
"USE": [[1, 7], [7, 10]],
"WANT": [[3, 7], [3, 8], [4, 8]],
"WAR": [[0, 6], [0, 9], [2, 6], [4, 9]],
"WEAK": [[5, 9], [6, 7], [6, 9]],
"XM": [[6, 7], [6, 9], [7, 10], [8, 9], [8, 10]],
"YOU": [[0, 7], [0, 8], [7, 8]],
"YOUR": [[0, 7], [0, 8], [7, 8]]
}
Some glyphs have multiple names (e.g. NO, NOT, INSIDE
); you must support them all.
Disclaimer: I couldn't find a good list of all of the glyphs, so I combined multiple sources and finally ended up drawing all of them in a hacked-together JS application to get the list of them. I may be missing some and there may be a couple of aliases not used in the game; I hope I didn't misdraw some of the glyphs, though.
Edit the next morning when it's not 4am: I already noticed VICTORY is missing. Oh well, it's left for the best golfer then.
Challenge
Your task is to create a program or function that takes in a name of a glyph, and outputs the glyph as an image.
The image must contain the grid points and the lines connecting the points in question.
This is code-golf, so the shortest answer in bytes wins. Standard rules apply.
I/O
You will take as input, in a format of your choice, a name of a glyph exactly as found in the keys of the above JSON object. Any other input is undefined behavior.
You will output an image in any common format with the glyph rendered to the grid.
Grid proportions
These proportions must be accurate to five pixels (to allow for rounding etc.)
- The outer points (0-5) must form a regular hexagon.
- The center point (10) must be in the center of the hexagon.
- The intermediate points (6-9) must be halfway between the center point and the corresponding outer points.
- The grid must be oriented like the original.
- The height of the outer hexagon must be at least 100 pixels.
Other rules
- The background must be either transparent or filled with a solid color.
- The lines and points must be clearly distinct from the background and each other; they cannot be of the same solid color.
- For example, solid blue lines and solid pink points is fine.
- Solid black lines and white points with black borders is fine.
- Red and white striped lines and footballs as points is fine.
- Solid green lines and solid green points is not fine.
- The radius of the points must be larger than the width of the lines.
- You may draw the lines in front of or behind the points.
- You may include any amount of padding (in the background color) in the image.
- You may combine consecutive lines into one line, since it doesn't affect the outcome.
Examples
The colors and object widths in these images are just examples that somewhat resemble the appearance of the game.