Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 12-02-2006, 03:44 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Chompy View Post
How I use Xor, is this >_>

PHP Code:
function onCreated() {
 
var1 "foo";
 
var2 "bar";
 echo(
var1 xor var2 0); // would return true
}
/*
   True  = Not alike
   False = Alike
*/ 
Quote:
Originally Posted by ApothiX View Post
X_x.. Why are you using xor on strings? That's not how it works :x
Might as well be doing be doing "f" xor "b" considering I believe binary operators compare only one binary value (that is, the first binary value per argument)... Not that that piece of code is of any use to anyone (see Okie's post). "f" xor "b" is char(6), whatever that is. char(6) has an ASCII of 6 which is not 0, thus is true...
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #17  
Old 12-02-2006, 05:45 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Tolnaftate2004 View Post
Might as well be doing be doing "f" xor "b" considering I believe binary operators compare only one binary value (that is, the first binary value per argument)... Not that that piece of code is of any use to anyone (see Okie's post). "f" xor "b" is char(6), whatever that is. char(6) has an ASCII of 6 which is not 0, thus is true...
well, xor works logically, too. I would imagine that that would return false since both strings exist.
Reply With Quote
  #18  
Old 12-02-2006, 09:30 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by ApothiX View Post
X_x.. Why are you using xor on strings? That's not how it works :x
Some guy told me to try out xor on strings
I have tried it on binary's, but I didn't quite understand it all
__________________
Reply With Quote
  #19  
Old 12-06-2006, 12:55 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Chompy View Post
Some guy told me to try out xor on strings
I have tried it on binary's, but I didn't quite understand it all
xor is both a binary operator and a bitwise operator!

boolean xor boolean : one or the other but not both
int xor int : see my bitwise operators tutorial
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.