Hi all! Find my finished project here: (there is also a link to run the code online!)
GitHub - chrysippa/new-greek-myths: Random message generator for myths.
It generates ‘New Greek Myths’ - stories with elements taken from real myths, and involving randomized characters and places. Some of the randomized elements sound out of place in a myth, just to make it fun
I thought the project was pretty easy. It did take up a couple days of my spare time, but that’s mostly because I had way too much fun coming up with the story templates and digging around for names to use.
I did run into one problem and I’m wondering if anyone else has dealt with it too. Since I was adding random elements into an otherwise pre-written story, I opted to use a template literal string. Instead of leaving the stories as one line of super long text that runs off the screen, I wrapped them at about 80 characters per line, but when you wrap a template literal, there appears to be no way to keep it indented at the same level as the rest of the code. If you do indent, that indentation becomes part of your string, because… template literals take you literally. A quick Google search didn’t come up with any good solutions, except maybe concatenating short segments together, and not only would that look kind of ugly (in my opinion) it would also be labor-intensive if I want to update the stories and the line lengths change.
What do you guys think? Did you also have long strings, and handle them differently? Should I try concatenation because indentation is important for readability? I’m tempted to leave it as is… but it looks gross