Design and documentation journal for my interactive fiction (text games); also reviews and other miscellaneous stuff.

Monday, August 8, 2011

In Which I Realize Something Obvious About Inform 7

Just now I realized that instead of typing "Every turn when the minutes part of the time of day is 00:" eighteen thousand times, I could just make a set of every hour rules, trigger them once, and then just specify "Every hour: do stuff!"

Makes the code easier to read and write.

1 comment:

  1. I don't know Inform 7, but I do know the feeling of suddenly realising you've been doing something the hard way for months.

    My example is reading someone elses code and coming across a really simple helper function called "RandomNumberBetween(x, y)", and suddenly realising I could have been doing that the whole time instead of manually adding and multiplying my random numbers into the correct ranges. Cue facepalm.

    Cheers,
    Quasar

    ReplyDelete