Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Mad-Libs/Zkl/mad-libs.zkl
Normal file
9
Task/Mad-Libs/Zkl/mad-libs.zkl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
story,line,re:=Data(),"",RegExp("(<[^>]+>)");
|
||||
do{ line=ask("Story: "); story.write(line,"\n") }while(line);
|
||||
while(re.search(story,True)){
|
||||
z,ml,N:=re.matched,z[1],z[0][1]; // z=( (0,6),"<name>" )
|
||||
s:=ask("Text to replace ",ml," with: ");
|
||||
while(Void!=(n:=story.find(ml))){ story[n,N]=s } // replace all <names>s
|
||||
}
|
||||
println("-----------------");
|
||||
story.text.print();
|
||||
Loading…
Add table
Add a link
Reference in a new issue