A FULLY FUNCTIONAL BATCH IMPROV
In Chapter 15, I built a rudimentary version of BatchImprov.bat that shared a single joke, riddle, or pun. In later chapters, you learned several tools to enhance this process, such as reading files, loading arrays, and using a random number to select an arbitrary element from an array.
Now let’s put it all together into an enhanced bat file that first reads library files containing any number of jokes, riddles, and puns, and loads them into arrays. Then the BUI will randomly retrieve and share one example of the user’s requested humor before asking if they want another offering.
Starting with the data, here ...
Get The Book of Batch Scripting now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.