I wrote a function that’s supposed to subtract two integers without letting the result go below 0. It compiles, but it doesn’t do anything. Does anyone know why?

[code]The Classroom is a room.

To carefully subtract (X - a number) from (Y - a number):
now Y is Y - X;
if Y < 0:
now Y is 0.

New Value is a number that varies. New Value is 20.

Every turn:
Carefully subtract 25 from New Value;
say “[New Value]”.[/code]

Your phrase is not returning the value that it’s calculating. It’s processing the two temporary values X and Y and then just throwing away the result. Try this:

[code]The Classroom is a room.

To decide what number is (X - a number) carefully subtracted from (Y - a number):
if Y - X is less than 0, decide on 0;
decide on Y - X.

New Value is a number that varies. New Value is 20.

Every turn:
now new value is 25 carefully subtracted from new value;
say “[New Value]”.[/code]