Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Equivalent of NOT Operator

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Mr B




Joined: 20 Mar 2003
Posts: 382

PostPosted: Tue Sep 14, 2004 1:30 pm    Post subject: Equivalent of NOT Operator Reply with quote

What is the equivalent of a NOT operator? I am trying to retrieve a tage value and toggle it. Would this work as well?

Code:
set tag(tag:lantern, (get tag(tag:lantern),XOR,true))
Back to top
View user's profile Send private message
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Tue Sep 14, 2004 3:24 pm    Post subject: Reply with quote

That works. I usually say "==false" instead of "NOT."
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Machu
Righter, a person who rights wrongs




Joined: 09 Jul 2003
Posts: 737

PostPosted: Tue Sep 14, 2004 5:36 pm    Post subject: Reply with quote

If you are making a tag toggle, you could say:
Code:
if (check tag (tag:lantern))
then (set tag (tag:lantern, false)
else (set tag (tag:lantern, true)

(I'm just saying code off the top of my head; not sure if that's the exact syntax)
_________________
Code:
[*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing
Back to top
View user's profile Send private message
Guest







PostPosted: Wed Sep 15, 2004 5:57 pm    Post subject: Reply with quote

If you want a logical NOT, 'x == false' works fine, as well as many other expressions.

If you want a bitwise NOT (complementary bits), use 'x, xor, -1' (assuming that the sign bit is used in the mask, is it? If not, use 'x, xor, 32767')


Which is completely off the subject as the qustion has been answered.
Back to top
Guest







PostPosted: Thu Sep 16, 2004 10:02 am    Post subject: Reply with quote

Thank you very much. The "==false" is much less unwieldy (more wieldy?) than my XOR stuff.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group