I’ve held this idea for a while & played a employing card game last night with friends, I decided to make a rejection letter generator. So potential ✨trigger warning✨
https://editor.p5js.org/Joycie/sketches/5p6VI4_lH
I decided to source the sample text from my own rejection letters, so I went back to my email box and wrote a .txt file for about 150 lines from 10+ rejections.
.txt screenshot
Then I decided to start, but the example I had seems too basic so I went back to the class examples, and after looking through them I found tracery is the best fit.
I couldn’t figure out a way to sort out the data (even with ChatGPT) so I had to enter.. each category’s data… manually. After figuring out the basic structure of each rejection letter, I created beginning - transition - appreciation - end.
Then I got this ^^
I wanted to add user-defined names to make this more related, so I created an input to pass down the value. I couldn’t figure out how to add the name data back to the grammar structure so I asked Chat, and here’s the code that works out:
function generate() {
const name = document.getElementById("nameInput").value;
data.name = [name]; // Directly update the data object
grammar = tracery.createGrammar(data);
Here is the final result: