17 lines
513 B
Text
17 lines
513 B
Text
|
|
procedure main()
|
||
|
|
ml := "<name> went for a walk in the park. There <he or she> _
|
||
|
|
found a <noun>. <name> decided to take it home." # sample
|
||
|
|
MadLib(ml) # run it
|
||
|
|
end
|
||
|
|
|
||
|
|
link strings
|
||
|
|
|
||
|
|
procedure MadLib(story)
|
||
|
|
write("Please provide words for the following:")
|
||
|
|
V := []
|
||
|
|
story ? while ( tab(upto('<')), put(V,tab(upto('>')+1)) )
|
||
|
|
every writes(v := !set(V)," : ") do
|
||
|
|
story := replace(story,v,read())
|
||
|
|
write("\nYour MadLib follows:\n",story)
|
||
|
|
end
|