RosettaCodeData/Task/Mad-Libs/Red/mad-libs.red
2023-07-01 13:44:08 -04:00

5 lines
276 B
Text

phrase: ask "Enter phrase, leave line empty to terminate:^/"
while [not empty? line: input] [append phrase rejoin ["^/" line]]
words: parse phrase [collect [any [to "<" copy b thru ">" keep (b)]]]
foreach w unique words [replace/all phrase w ask rejoin [w ": "]]
print phrase