With nothing much to do on a wet and windy Bank Holiday Monday (why does it always rain on bank holidays?), my wife suggested that it would be a good idea to clean out some cupboards and drawers. With the kids engrossed in front of the TV we spent a couple of hours sorting out, throwing away, rearranging and tidying up. The result was lots more space, the ability to find things and a bag or two of rubbish.
This bout of spring cleaning triggered the thought in my mind that my Inform 7 code needed a similar approach. I am now going through it top to bottom and reviewing and trimming it. It is amazing what is in there that is redundant, needs tidying up and sorting into a logical order. I am also using the opportunity to add rule names (really helpful when debugging) and using the new Pythonesque code indentation for conditions and loops. I did not think that I would like this but having used it several times now, I much prefer the structure.
Another benefit of the review is that I am spotting things that need to be corrected or supplemented. One section of the code allows the player to look under something to find things that are hidden. The code works but it was indiscriminate. Elsewhere in the game, I have a backdrop called the sky. Typing “look under the sky” produced the response “You find nothing of interest.” A similar response was received if the player looked under the floor (not an everyday thing that you do unless armed with a pick-axe).
All I need now is a few more wet weekends to encourage me to continue the code clear out!

Leave a comment
Comments feed for this article