Jump to content

Mad Libs: Difference between revisions

(Add Batch File Solution)
Line 404:
 
=={{header|Batch File}}==
This implementation takes a file from command line. This will not validate the input exceptEXCEPT when the user inputs word/s surrounded by angle brackets and a percent sign(%) is found in the input. For example, if the user inputs:
<pre>Enter a value for [Sample Variable]? <blabla> </pre>
Then, the term 'blabla' will interpreted as blank...
<br>
<lang dos>::Save this as MADLIBS.BAT
 
Line 469 ⟶ 470:
set "chk_brack=!input:>=!"
set "chk_brack=!chk_brack:<=!"
set "chk_brack=!chk_brack:%%=!"
for /l %%. in (1,1,!cnt!) do (
if "!chk_brack!"=="!input!" (
535

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.