Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Mad-Libs/VBScript/mad-libs.vb
Normal file
18
Task/Mad-Libs/VBScript/mad-libs.vb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Function mad_libs(s)
|
||||
Do
|
||||
If InStr(1,s,"<") <> 0 Then
|
||||
start_position = InStr(1,s,"<") + 1
|
||||
end_position = InStr(1,s,">")
|
||||
parse_string = Mid(s,start_position,end_position-start_position)
|
||||
WScript.StdOut.Write parse_string & "? "
|
||||
input_string = WScript.StdIn.ReadLine
|
||||
s = Replace(s,"<" & parse_string & ">",input_string)
|
||||
Else
|
||||
Exit Do
|
||||
End If
|
||||
Loop
|
||||
mad_libs = s
|
||||
End Function
|
||||
|
||||
WScript.StdOut.Write mad_libs("<name> went for a walk in the park. <he or she> found a <noun>. <name> decided to take it home.")
|
||||
WScript.StdOut.WriteLine
|
||||
Loading…
Add table
Add a link
Reference in a new issue