header image
The world according to David Graham

Topics

acva bili chpc columns committee conferences elections environment essays ethi faae foreign foss guelph hansard highways history indu internet leadership legal military money musings newsletter oggo pacp parlchmbr parlcmte politics presentations proc qp radio reform regs rnnr satire secu smem statements tran transit tributes tv unity

Recent entries

  1. PMO Staff Run Government; Ministers Represent It
  2. On A Mostly Harmless Birthday
  3. The Trouble With Political Communications
  4. Politics: War By Other Means
  5. On the function of Social media
  6. C-18 is an existential threat, not a benefit, to democracy
  7. On Missing A Little More Than A Sub
  8. The Realpolitik Of Open Nomination
  9. What Is An Open Nomination, Really?
  10. Alberta election about identity, not policy
  11. The Trouble With Electoral Reform
  12. Mr. Bains Goes to Rogers
  13. Question Period
  14. Why do lockdowns and pandemic restrictions continue to exist?
  15. Parliamentary privilege: an arcane concept that can prevent coups
  16. It's not over yet
  17. Trump will win in 2020 (and keep an eye on 2024)
  18. A podcast with Michael Geist on technology and politics
  19. Next steps
  20. On what electoral reform reforms
  21. 2019 Fall campaign newsletter / infolettre campagne d'automne 2019
  22. 2019 Summer newsletter / infolettre été 2019
  23. 2019-07-15 SECU 171
  24. 2019-06-20 RNNR 140
  25. 2019-06-17 14:14 House intervention / intervention en chambre
  26. 2019-06-17 SECU 169
  27. 2019-06-13 PROC 162
  28. 2019-06-10 SECU 167
  29. 2019-06-06 PROC 160
  30. 2019-06-06 INDU 167
  31. older entries...

October 27th, 2002 (from Advogato)

@echo off
mem/d|find/i "ANSI">nul
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.

*sniff*

Posted at 17:42 on October 27, 2002

This entry has been archived. Comments can no longer be posted.

September 26th, 2002 (from Advogato) | foss | November 30th, 2002 (from Advogato)

(RSS) Website generating code and content © 2001-2020 David Graham <david@davidgraham.ca>, unless otherwise noted. All rights reserved. Comments are © their respective authors.