October 27th, 2002 (from Advogato)
if errorlevel 1 goto :error
echo %0%1%2%3%4%5%6%7%8%9|find/i "/?">nul
if not errorlevel 1 goto :help
The opening lines to boggle, as I wrote it in DOS .batch in highschool.
Remember batch files?
They were the only redeeming feature of DOS. They allowed me to learn basic coding skills without getting any kind of compiler or trying to squeeze Linux onto my XT or my PS/2 (personal system, that is, not playstation).
There were only a couple of things you couldn't do without getting additional binaries not included in a basic DOS system.
Mainly, you couldn't sleep, and you couldn't read the keyboard once the "program" was already in progress. To solve these, I used a small file called "keytrap.exe" which was a whopping two or three lines long written for me by an acquaintance with a compiler named Chris Micali, and two small files called getkey.com and getscan.com which were 8 and 10 bytes respectively, and sleep.exe which I got off shareware.com eons ago, and have long since lost the associated license file.
With those tools I spent entirely too much time writing batch files throughout my years at NMH.
For the sake of sheer, morbid curiosity, I've posted a small selection of these batch files here. I strongly recommend NOT running any of them without backing up and quarantining your archaic little DOS box.
Note the existence of "random" number generation in some of those files, particularly the game of boggle.
alias.bat was my attempt to have something with similar functionality to alias in a variety of un*x shells. I had shell access from the computer labs and found this to be a useful little tool missing in DOS. Careful though, alias is a self-installer which makes sure ANSI.SYS is loaded and burrows itself in its own directory.
Once I finally bought a Linux-capable box, I was disappointed to learn that random numbers could be obtained across a large range using a single line in bash - rather than the 200 lines with a limited range of 1 to 100 found in batch - and that reading keyboard input and sleeping could be done without batting an eyelash.
It took all the fun out of scripting.
Posted at 19:42 on October 27, 2002
This entry has been archived. Comments can no longer be posted.