Is this:

A)

while (!isLegal(move, board))

the same thing as:

B)

while (isLegal(move,board) = !!)

?

Recommended Answers

There is no such thing as = !!. What you want is != 0

Jump to Post

Yes, I actually had the statement backwords -- should have been == 0 as previously noted.

The not operator ! means 0, not false. There is no requirement for false to be 0.

Jump to Post

All 5 Replies

There is no such thing as = !!. What you want is != 0

Example A's parameter is saying "while this function returns false..." Right?

Does !=0 mean false?

That means true. You're saying if it is not equal to zero, which is true.
(variable==0) means while it is false or (variable==false) means while it is false

Yes, I actually had the statement backwords -- should have been == 0 as previously noted.

The not operator ! means 0, not false. There is no requirement for false to be 0.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.