You can use the preformatted text button in the options when posting to include the code in boxes like below:

```
*rand x 1 3
*if ((x-round(((y-z)/2)))<0)
*set (x-round(((y-z)/2))) 0
*set w -(x-round(((y-z)/2)))
```

So one thing that is wrong here is that this line in particular (the one inside the *if):

`*set (x-round(((y-z)/2))) 0`

Has no variable being assigned the value of 0 (I’m assuming that’s hat you wanted to do?), so it wouldn’t really work; a variable must receive the value.

`*set variable what_to_receive`

And also what exactly that goes wrong? Is there an error message or just the calculations don’t amount to what you want?

I didn’t really understand what you were trying to do. I’m guessing you want to check if the equation is lower than 0, if so, set it to be 0. Then subtract w with the result of the equation? That’s what I got from it at least.

First, it’s better if we separate things for clarity. Let’s use result variable to receive your equation results first.

Then we compare if it’s less than 0. If so, set it to be 0.

Since subtracting something by 0 won’t matter, I added the *else.

If result is a positive number it will go through the *else and subtract w. Is this what you wanted to do? Or did you wanted w to receive the reverse of the result?

```
*temp result 0
*rand x 1 3
*set result (x-round(((y-z)/2)))
*if (result <= 0)
*set w 0
*else
*set w - result
```