I think that could be a real asset for introducing programming in the classroom via games. Remove the explicit INPUT and OUTPUT instructions, make the grid larger (to avoid the cramped space), greatly reduce the difficulty curve, maybe add in re-usable components on the reactor level, and find a better way of doing extra state than SpaceChem (flip-flops) and LightBot 2.0 (colours). Dump the atoms to avoid the chemistry link and replace them with farm animals, or sticky balls of goo, or whatever. I feel like there is a great game to be made, suited to a much wider range of students, based on SpaceChem’s core template. SpaceChem is too hard to give to most students, but it has a nice programming model and visualisation that has a higher ceiling than any other programming game. You can see the two tracks in action in SpaceChem’s intro video: You soon start using two threads in tandem (one red instruction pointer, one blue), which leads to issues with race hazards, so you have to start using a SYNC instruction to coordinate. But SpaceChem is not content to build up a progression of simple puzzles. SpaceChem shares several traits with LightBot: it has a clearly defined goal (the atoms that you must output), all the state is visible at once (essentially, the grid, and the atoms currently present), and it’s relatively easy to see how the instructions get executed. The complexity is quickly on a different level to that of LightBot: if LightBot is for kids playing around, SpaceChem is for teenagers or adults who must apply serious brainpower. a fetch-bond loop) can (and must) be re-used as part of larger solution. Problems must be broken down into smaller steps or else you have no hope of solving them. You must make sure you output old data before attending to the new data: a primitive sort of scope. You must consider state and dependency a lot more: INPUT instructions must execute before the PICK UP instruction, so that the atom is ready to be picked up. LightBot has functions and basic recursion, but SpaceChem has an abundance of loops, and in fact has control flow beyond most programs (instructions can usually be executed twice by lying where two control paths intersect). The instruction track is a loop, so the program will repeat until enough output atoms have been produced.Īlthough SpaceChem is primarily a sequence of instructions to be executed, as in RoboRally or LightBot, there is also a strong element of control flow. The INPUT node will summon an atom to the input area, PICK UP will pick it up, so that the instruction pointer carries the atom around the track, until the PUT DOWN node is reached, and then the OUTPUT node sends it off. Each square can have 0 or 1 arrows and 0 or 1 instructions. It then follows the path traced by the blue arrows. The blue instruction pointer (the hollow circle) starts at the START node. Here is the solution to one of the early puzzles involving simply shuffling a molecule from the input area (left) to the output area (right): The difference between SpaceChem and text-based assembler is that the “memory” is a 2D grid, the instruction pointer moves on a two-dimensional track of your choosing, and the data to be manipulated is represented by chemical atoms which can be bonded together. It has two parallel threads of execution, each with an instruction pointer (called a “waldo”) and a series of instructions that are rather familiar: input, pick up (load), put down (store), output, and later on: conditional execution. SpaceChem is rather close to assembly language programming. Now that we’ve set out its flaws, we can go on to look at why I believe SpaceChem to be the best programming game yet made. Its interface is rather, well, austere (see picture below), the tutorial is a bit sparse, and it’s difficulty curve is a lesson in what the function looks like. SpaceChem is a programming game, through and through. For starters, it has a dull, misleading name: it may sound like a chemistry game, but it’s got only slightly more relation to chemistry than Angry Birds has to birdwatching. In this series on games that involve programming as part of playing, I’ve so far covered RoboRally and LightBot, and this time it’s on to SpaceChem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |