Question about Equations (SOLVED)

(i figured this out (see bottom). It seems writing out this post helped me wrap my head around it. Thanks anyway)

I am having trouble writing a very simple equation.

Ive simplified the code i am actually using, to make it easier to understand my problem.
(i’m sorry, i forget how to make something CODE in the posts here)

After saying hello to Redd Osbourne for the first time:
let C be the confidenceAtt of the player;
let P be the perceptionAtt of the player;
let W be the wisdomAtt of the player;
if C+P+W<9:
say “TEXT”.

(all of my indentation is correct in my code, i just cant remember how to do that here)
The problem/error im getting is in the equation. This is obviously not the correct way to write it but for the life of me, i can not find how to write it. Ive read the numbers and equations documentation up and down and this simple thing eludes me.

From what i can tell, inform wants me to dictate the equation first, then use “let X be given by (name of equation)”. Is that how i have to do it? or is there just a proper syntax to write it the way i want to.

In other words, what is the proper way to write “if C plus P pus W is less than 9”.

I could be completely off base here, i dont know. The examples used for the numbers and equations section of the documentation make my brain melt. I believe that i have a great understanding of Inform, but that section just makes me want to slam my head against a wall, lol.

Thanks for any help!

In case you were curious, i did this…

Equation - Convo Equation
T = C+P+W
where T is a number, C is the confidenceAtt of the player, P is the perceptionAtt of the player, W is the wisdomAtt of the player.

Then just put “if T is less than 9” where i had my equation.

That works just like that. Assuming you fix the typo in “plus”.

Hmmm, that is odd… because that was the first thing i tried but i got an error. (it didnt have the typo, lol). Well, either way, the new way i did it worked just as well.

Also, just would like to say that you, Zarf, and Draconis (others, also) do one heck of a job here. You are quick to respond and very polite, even when it isn’t the “brightest” of questions ( like mine, lol). I appreciate it. Thank you.

The problem in your original code was probably that you didn’t put spaces around the plus and less than signs. As mentioned in section 15.5 of the documentation they’re mandatory (outside of an Equation like what you later used), but of course if you’re used to an ordinary programming language that might surprise you.

Hit the “code” button above the window where you type your comments (between “quote” and “list”). Then if you paste your code in between the code tags the indentations will be preserved.

Alternatively you can type the code tags in by hand, like this:


paste your code here [/code]

(What’s inside the code block is what you actually type. I had to put it in a code block so the tags themselves didn’t get processed… if that’s too confusing, just use the “code” button.)