Shell script of the gods
One of the concerns I had with the programming contest problem was deciding what kind of fictional context to use. What kind of scenario could explain the need for a single automated solution to a suite of problems, even those that had already been solved?
The need to expose the player to such a test suite is twofold. We would like to introduce the player to the idea of breaking tasks down into reusable subcomponents. I thought I would give the player some small task to accomplish, thoroughly testing that the automation he produces works in every case, and then giving him access to that solution as a component to solve future problems. In this way, at least as one part of the level progression, we would coerce the player to build up a library of functionality.
The other aspect is the pedagogical model described yesterday. The gist is that a series of specific exercises are used to illuminate a general concept.
So here's the story: In a pantheon, you are the god of automation, or perhaps ritual. All of the other gods have vanished. While exploring the reason for their disappearance, you enter into their quarters in Olympus and find yourself invoked by their worshipers. When you are summoned in the name of another god, you have the ability to use that god's power, theoretically in some limited context to placate the supplicants. Initially these powers will be very limited, such as the ability to cause crops to grow or heal cattle.
The pleas of the faithful never cease. If you had no other option, you would be eternally at the whim of these worshipers to do these tasks manually (they are sounding more like demon summoners at this point, you are bound to do a boon) . However, the interesting wrinkle is that as god of automation, you have the power to set up a system to do these things for you, and you can install it in the place of doing the deity work yourself. I don't yet know precisely how this would manifest, but it would require the summoning to include somehow a symbolic description of how the task is to be accomplished, in fact a program in some specialized ritual language. The scenarios would each be set up so that it is clear what the player needs to do, and thus the task would be two parts:
- Figure out how the symbolic representation represents the work that needs to be done (this is the game-supplied program).
- Construct a program to do it for you (this is the user-provided interpreter).
This is similar to the decoding game I recently described, and it is possible that these could both be parts of the same game.
Once you have automated a deity correctly you can then summon it yourself to do work for you in other problems. As each deity has its own ritual language, this has the possibility to introduce a whole slew of programming primitives and language types, in addition to the various powers each god commands.
What kind of language does the god of automation himself use? That is, what is our starting point? I think Lisp or something like it is a good candidate, and I will suggest a possible mechanism for importing lambdas and s-expressions into video games in a future post.