fork download
  1. import re,random
  2. s=input()
  3. exec"print''.join(t*(t!=''and(t[0]!='{'))or random.choice(t[1:].split('|'))for t in re.split('({.*?)}',s));"*5
Success #stdin #stdout 0.01s 10088KB
"{A|The|One} {quick|magnificent|charming|lucky|fast|super|cool} {gold|tan|yellow|white|brown|silver} {beaver|packrat|cat|lion|tiger|fox|dog|wolf} {consumed|ate|pilfered} my {pastry|strudel|cake}."
The cool silver packrat consumed my cake.
One charming brown fox pilfered my strudel.
A magnificent yellow tiger consumed my strudel.
The fast brown dog pilfered my pastry.
The super yellow packrat pilfered my strudel.