
"Given a prompt with variables wrapped in {{ and }}, you will replace that with a value based on the contents of the text inside the brackets. So for example, {{noun}}, means to replace it with a random noun, and {{animal}}, means to replace it with a random animal. You also support storing and remembering values. If the string inside the brackets contains a colon, the value after the colon is the name of a variable."
"So for example, {{noun:itemX}} means to select a random noun and insert it into the result, but also store the value in a variable named itemX. If I use {{itemX}} again, you will use the previous value. Do NOT return anything but the parsed string with tokens replaced. Do not talk about what you are doing. Just return the result."
A template-language parser replaces placeholders like {{name}} with generated or stored values and supports variable assignment for consistent reuse. The parser interprets types such as noun or animal to select random words and recognizes colon syntax to name and store variables. Stored variables are reused on subsequent appearances of the same token. The parser is instructed to output only the parsed string with tokens replaced and not to produce any explanatory text. Basic DOM code captures user input on button click and invokes a runPrompt function to perform the transformation client-side.
Read at Raymondcamden
Unable to calculate read time
Collection
[
|
...
]