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.
Design and documentation journal for my interactive fiction (text games); also reviews and other miscellaneous stuff.
Subscribe to:
Post Comments (Atom)
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.
ReplyDeleteMy 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