#1

I was wondering - in turbo pascal we have or and xor operators. Does pawno have an alternative for xor? (1011 xor 0101 = 1110)
Reply
#2

The logical XOR should be something like this
pawn Код:
p = true;
q = true;
(p || q) && !(p && q)
1 and 1 is 0
1 and 0 is 1
0 and 1 is 1
0 and 0 is 0
Reply
#3

That would, in some cases, get it done, but how can I make it work with integers? I just sooo need a xor operator around here...

Example: 6 xor 2 = 7 (binary: 0110 xor 0010 = 0111)
Reply
#4

Look in YSI, the misc file contains one IIRC.
Reply
#5

Maybe you know where I could find a pawn function that would convert an integer to binary code? Or atleast emulate that with outputing an array/string of integers (1-0)
Reply
#6

Take a good look HERE It's pertaining to keys and keys are in binary.
Reply
#7

XOR is ^. e.g. a ^ b

The guy just wants xor people...
Reply
#8

The XOR operator in PAWN (and most C-like languages) is ^.

(Oh damn you...)

Also, https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange does not contain an example of exclusive or.
Reply
#9

Thanks. I don't really know C languages that well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)