I previously wrote about finding some old public domain routines I’d written, lost, and found via Google on some compilation CD on the Internet. Processing that bit of history inspired me to document the only really old program I still have of mine, which somehow survived the media purges in the intervening decades.
It’s called “Inquiry”, and it was an instructional software program for DOS. Here’s a video of me explaining what it’s about…
When I was 15 I was trying to write video games. I was dissatisfied that all the key reading routines I had access to from the Turbo C manuals only let you read one key at a time. Even that one key couldn’t handle being held down very well… there’d be a long pause after the first press before you’d start getting signals indicating the key was being effectively “pressed again”.
Yet I knew it was possible to do better than this. I’d seen games that would let two players use the same keyboard, each pressing a direction key and a key that led to a “firing” action. At least four keys could be held down at a time, running smoothly.
Ever curious, I talked to some programmers about it. From the information they gave me, I was able to write some code to do it, and a test program which revealed the limits of the particular keyboard I was using. When I’d finished it, I uploaded it to a dial-up BBS (using my trusty 2400bps modem :-P) and released it to the public domain.
The 5 1/4 floppy I had it on (as well as most all my other early programming projects) were lost to the sands of time. Until a Google search on my name found it had made it onto a programming tools compilation CD somewhere, and that CD’s contents had been put up on a public FTP site. The only natural response was to put it up on GitHub:
The code is not that interesting or relevant today. Critiquing it given my modern knowledge is hardly useful; I don’t need to teach myself how to write circa 1990 code in a better way. More interesting is the original READ.ME I wrote to accompany the ZIP file… for comparing my writing style then against how I write more than two decades later. It’s not all that different!
Also interesting to point out is that even when I was writing short C snippets as a teenager, I was zipping it up and sharing it for free. I can rightfully claim to have been involved in the open source movement for over two decades! Though I seemed to think that you could release library routines to the public domain and prevent people from selling those routines. Public domain is a sticky legal term even today…and has given rise to more rigorous alternatives like the CC-ZERO license.
I’ve included a video of me showing a demo, and provided a formatted copy of the original READ.ME content… so now I can delete it off my disks (again!)
StackOverflow has a tag for so-called “Code Golf”, which has the goal of attempting to perform a programming task with a program that has a minimum number of ASCII characters.
There are several loopholes:
You can obviously define a language which specifically performs only the one task, and uses a single-character program to do it (e.g. if the task is to print “Hello World”, you can make a fictitious language in which the single character program h will do it)
You can compress your program into a form where it is no longer the sort of thing a human can reasonably read or write (e.g. the hexadecimal representation of assembled machine code)
But a real Code Golf language needs to be Turing complete. Furthermore, I feel that you should be able to give an arbitrary challenge to a programmer they could write a working program without machine assistance. It should also be feasible to make minor adjustments to the program’s behavior without using some kind of tool. My opinion is that in this respect, Rebol has potential to be the most impressive language for Code Golf ever created.
However, Rebol has striven for a verbose English-like wording scheme. So out of the box, its ability to compete is hampered against less ideal languages that have been purposefully shortened for this purpose (like GolfScript) Yet I began to wonder if the language could be configured in a trivial way that preserved its basic character (so it still passed the language parser) but that made it more terse.
I’ve decided to call my idea “Rebmu” (REBμ) the Microsocopic Rebol Dialect for solving code golf challenges! You can find a proof-of-concept source file on GitHub which has some documentation, but this post goes into some detail as well…
Jeremy Friesner brought this site about analog literals to my attention. It provides the long-needed ability to represent integer constants in C++ not as numbers (like 42) but rather as 1-D, 2-D, or 3-D shapes whose length, area, or volume correspond to the number’s quantity. So for instance:
| L \
| L \
o-------------o ).volume==( o-------------o
That’s great! As the inventor of Arecibo ASCII, I fully support this visual double-check with our intuitions about numbers! What if aliens are trying to read our code, but don’t know about our arbitrary choices of digits and numeric base?? This could bridge that important gap!
But there’s one nagging concern I have, which is that I don’t think the 1-D numeric values are very intuitive. Look at these examples from the site:
I’d prefer it to more consistently depict the historic concept of zero, and be less arbitrary with the “2N+1″ formula of dashes to implement value N. So why not overload dereference and multiply, and define “II” to be the constant value zero? This way you can get: