Mad Libs: Difference between revisions

m
→‎{{header|Sidef}}: modified code to work with the latest version of Sidef
m (→‎{{header|Sidef}}: modified code to work with the latest version of Sidef)
Line 2,169:
 
var blanks = Hash.new;
while (storyvar m =~ /<(.*?)>/g.gmatch(story)) {
blanks.append($1m[0]);
}
 
blanks.keys.sort.each { |blank|
var replacement = Sys.scanln("#{blank}: ");
blanks[{blank]} = replacement;
}
 
print story.gsub(/<(.*?)>/, {|s1| blanks[{s1]} });</lang>
 
=={{header|Tcl}}==
2,747

edits