It looks like you're new here. If you want to get involved, click one of these buttons!
<<set $kindness to $walked_dog + 2*$fed_horse + 5*$rescued_kitten>>and I would like to be sure that the result will be 8 if those three things are true, no matter what computer this game is played on.
<<set $kindness to 0>> <<if $walked_dog>><<set $kindness += 1>><</if>>and so on, but that's horrendous and I'd rather not have to.
Comments
Why do something in multiple lines if I can do it elegantly in one line? Not to mention having to wrap it in <<silently>> to avoid lots of unwanted white space, and that would be even more clutter.
Now, to what you really want to know. When boolean values are coerced into numbers, true should yield the value 1 and false the value 0. Thus, yes, what you're attempting to do there should work.
Coercing in the opposite direction is not so clear cut, as while the number 0—and NaN—does coerce to false, all non-zero numbers coerce to true.