Hello all,
I am pretty new to IF and I really like the Inform7 language for it’s expressiveness and beauty. So I’m doing some random tests at the moment as well as reading the fine documentation. But until now there were mentioned 6.6. Whereabouts on a scale? But how do I convert a property acording to that scale? Can I7 do that for me?
Here is an example with a simple property hunger level (it should decrease every turn, but that’s an other subject). I’ve managed to get a solution for printing the apparent hunger of person, when it’s examined. But I think this not quite elegant.
[code]“Hunger”
A person has a number called hunger level. The hunger level of a person is usually 10.
Definition: a person is starving if its hunger level is 0.
Definition: a person is hungry if its hunger level is 5 or less.
Definition: a person is saturated if its hunger level is 7 or less.
Definition: a person is well-fed if its hunger level is 9 or less.
Definition: a person is abundant if its hunger level is 10.
Instead of examining a person (called p):
say "[The noun] seem[if the noun is not the player]s[otherwise][end if] to be ";
if p is starving:
say “starving”;
else if p is hungry:
say “hungry”;
else if p is saturated:
say “saturated”;
else if p is well-fed:
say “well-fed”;
else:
say “abundant”
The player is starving.
The yard is a room. Alice, Bob, Eve, Marvin are persons in the yard. Alice is abundant. Bob is well-fed. Eve is saturated. Marvin is hungry.[/code]
Any opinions or hints are appreciated.
Cheers,
Thul