Q: Create a less redundant version using otherwise or return.

< Previous | Contents | Manuals Home | Boris FX | Next >

and rules about "whole an object" see the bonuses? Q: Create a less redundant version using otherwise or return. A: In this first one, the first otherwise is important. Try leaving it out.

define a procedure to say the sign of a number.

if the number is greater than zero, say "it's positive". otherwise if the number is less than zero, say "it's negative". otherwise, say "it's zero".

done.

define a procedure to say the sign of a number.

if the number is greater than 0, say "it's positive" and return. if the number is less than 0, say "it's negative" and return. say "it's zero".

done.

For each version, or your own, say the sign of 2, say the sign of 0, and say the sign of -5.

For an example of similar rules, see the rules about x polarity .


©2024 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.