Ah, booleans can be pretty confusing for someone new to programming.
If statements operate solely on booleans; the block of code in the "if"
is only executed if the condition in the "if" statement is true.
The condition in the "if" is
always a boolean. For
example, in the code
"x == 6" is a boolean. When you use a comparison operator in an
expression, the expression will be evaluated and return
true
or
false based on, obviously, whether the expression is true
or false.
So basically,
if (x == 6) is evaluated as
if (true) is x does indeed
equal 6, or
if (false) otherwise. When evaluating a boolean
variable, it automatically returns
true or
false without needing
a comparison operator.
Essentially,
is evaluated as
C#:
if ((someBool == true) == true)
and thats not really very efficient.
[edit]Oooops... I meant "x == 6". not "x = 6"[/edit]