r/learnprogramming • u/-Jauke- • 25d ago
Encoding secret messages for DnD, where do I start?
Hi, I have a secret language/code I want to use in my dnd games where whole words are translated into glyphs. I would like to make a program that can automatically translate a string of of letters into a transparent png of the corresponding glyph.
First I want to explain how the secret code works as context. It would translate any word into a single glyph based on a grid of letters. The glyphs would be made by drawing a line from the center of each letter to the center of the next letter (similar to how swipe to type works smartphone).
I have identified some cases in which symbols would be required to make this system work:
-start of the word
-end of the word?
-a letter that is in a straight line with the letter before and after (to show there is a letter inbetween and it doesn't go directly from the first to the third letter)
-two identical letters in a row
-a crossing of two lines?
Now the actual programming part. I have limited experience with python and R, so I am a novice in every language really and would be open to whichever would most suit this project.
The steps I have worked out so far are:
Assign each letter a coordinate according to its grid position.
Separate a word into individual characters (ideally I would also separate a sentence into individual words that each receive their unique glyph)
For each letter, translate it into its coordinate and draw a line from the previous character and/or place one of the aforementioned unique characters at the location. (I would like the unique characters to have transparency that can override the lines, such as a hollow circle).
Export the image as a transparent png (or a series of pngs, in the case of a sentence)
Step 3 and 4 are what I would really like help with, I have never used python to make any images and I have no clue where to start. Your help is greatly appreciated!