I’ve modified the original post so the code formatting works properly again.
This week’s prize, Bubbling Beaker Award® #31, is – like the most recent prize – presented to @eu1. In this award-winning post, he demonstrates a method for allowing the printed text of an object to vary depending on whether it is being referred to using a definite or indefinite article.
The sample code presented is a point solution requiring designation of a custom indefinite article property for each noun in question. It would probably be possible to install code to generically set the required flag at the I6 level, but this fundamentally more mad science approach is left as an exercise for the reader.
This is eu1’s fourth BBA, and the second one awarded to him in a row. Congratulations again, eu1!
… and with that prize issued, we’ve wrapped up a full year of Bubbling Beaker Awards. I’ve pretty much run out of posts that I had banked for nominations, so I think it’s a good time to call an end to the series. I may issue awards on an occasional basis, should anyone post anything particularly clever, on an ad hoc basis.
Until then: Thanks for reading, and keep those beakers bubbling!
Thank you for this great series, Otis!
Yes, thank you for this year of mad science!
Even though I’m not doing BBAs on a regular basis any more, I did say that anything “particularly clever” might receive an award in the future. This week’s prize, Bubbling Beaker Award® #32, certainly qualifies and is presented to @Draconis. In his award-winning post, he demonstrates a method for effectively deploying free-standing conditions within an I7 table by embedding those conditions within I7 texts.
It’s a terrible hack but beautiful in its effect. There’s not much to explain that isn’t immediately obvious from looking at the example; the genius is in spotting this potential for productive abuse in the first place.
This is Draconis’s fifth BBA, putting him just behind Zed for the title of Maddest Scientist. Congratulations, Draconis!
The wonderful thing about I7 texts is that they’re also effectively lambdas! Dealing with phrases and rules as first-class entities is somewhat awkward, but texts can often do the same job in a more straightforward way.
Versatile Listing relies on a similar hack, using a text to decide which property or phrase to print: passing “the description property” or a phrase that accesses the description to a list-writer is difficult, but “[the description of the object in question]” is easy!
I happened across another interesting item that seems notable to me. This week’s prize, Bubbling Beaker Award® #33, is presented to @vlaviano, who was a significant presence on the forum for a while but hasn’t been around for some years.
In this award-winning post, vlaviano demonstrates a method for triggering a taking all action via a phrase. The technique is dependent on the Editable Stored Actions extension by Ron Newcomb, which may be out of date for 10.1.2, though there is an earlier iteration on the same thread that has no dependencies (but is a little less robust).
The I7 compiler won’t allow the author to do this with a direct call such as try taking all, because “all” does not correspond to a single object and because the meaning of the word is context-sensitive to the world state so can’t be defined at compile time. The demonstration code gets around this limitation by creating an I6 phrase that does the job of “parsing all” on demand.
This is vlaviano’s first BBA, but I have run across many of his posts which were useful in understanding deeper parts of the system, and I appreciate his contributions to the mad science tradition. Congratulations, vlaviano!
An all-I7 method for going about this particular trick occurred to me:
The all-thing is a thing.
Instead of an actor taking the all-thing (this is the translate taking all-thing to taking all rule):
repeat with item running through things that can be seen by the actor:
try the actor taking item.
The basic accessibility rule does nothing when the noun is the all-thing.
Then you can just use a phrase like:
try [insert actor here] taking all-thing.
I was surprised to learn today that the built-in deciding whether all includes rules are specific to the player, but if you wanted to redefine those you could probably modify the above to take that activity into account.
Note that this does not invalidate vlaviano’s award! Quite often the important part of mad science is thinking up the goal.
Can it really have been five months since the last award?
This is one of those times where the award is not for the post itself but for the document referenced therein. As a special bonus, it is for a contribution of value to people who work purely within Inform 7 without resorting to Inform 6 inclusions.
Many people may have missed it when Celtic_Minstrel recently posted a new syntax reference document for Inform 7. It is well worth reading, showing a complete breakdown of the acceptable syntax for every kind of statement that Inform accepts – in other words, it is precisely the kind of reference document for which users of Inform have been crying out for many years.
I’ve been tinkering with I7 for quite a while now, and in going through it I have learned several new tricks even though I’m only about halfway through. In honor of this tremendous contribution to the common good in the true spirit of mad science, I am pleased to present this week’s prize, Bubbling Beaker Award(R) #34 to @Celtic_Minstrel.
Congratulations, Celtic_Minstrel! This is the second BBA that you’ve received. If you’d like to tell everyone a little about the document and your process in putting it together, the floor is yours. (I, for one, am curious about how you managed to work out the syntax details in the absence of official documentation. Was it just brute force experimentation?)
Part of it was experimentation, part of it was reading through what official documentation there is, part of it was reading things other people had written about Inform.
- I had most of the information gathered last year, so I don’t remember too clearly, but I think I might have skimmed through the entire manual (possibly, even including the examples) and noted down any details I could find.
- The annotated Preform document was also quite helpful for a few of the more obscure things, most notably the syntax of “table entries”. (I apparently downloaded it from here at some point in the past.)
- The Inform 7 for Programmers reference also helped in some areas (most notably action recurrence clauses).
- This post was quite helpful in illuminating the format of action patterns (or described actions). I don’t remember, maybe there were other posts here on the forum that helped.
- The thread itself was helpful as well, as it drew my attention to some things I’d overlooked.
So in summary, there were a bunch of different sources.
As to the content of the document, I focused more on syntax than semantics, although the “assertions” section is a bit loose with that – several assertions with special semantics, such as defining kinds, actually aren’t really special at the syntax level, but it seemed worth mentioning them separately anyway. I wanted the document to be a good place to go when you vaguely remember there was a way to do that one thing but you can’t quite remember the syntax for it, and searching the documentation isn’t turning up anything.
I don’t have much else to say about the document itself, other than that it’s still probably missing some small things or inaccurate in minor ways. So, please report any issues found!