Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Where is XOR gone?

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Sep 2015 22:01 Edited at: 10th Sep 2015 22:03
XOR is missing from AGK2. Has this been replaced by a symbol or something?

Edit: Oh yea - it's ~~

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Sep 2015 10:54
just xor would be too easy.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Sep 2015 12:17
#Const XOR = ~~

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 14th Sep 2015 17:38 Edited at: 14th Sep 2015 17:38
This does not work with "String" anymore!
WHY?!?!?!?!?!?!?!?!?
WHY?!?!?!?!?!?!?!?!?
WHY?!?!?!?!?!?!?!?!?
WHY?!?!?!?!?!?!?!?!?
WHY?!?!?!?!?!?!?!?!?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Sep 2015 20:27
@Chmava
something like this?


AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Sep 2015 10:45
Quote: "This does not work with "String" anymore!"


It's working OK for me. Markus' example looks like it will work.
You'll also see an example in the next newsletter tutorial.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 15th Sep 2015 11:35
btw, it would be much faster if we can replace a char with mid$.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 18th Sep 2015 21:42 Edited at: 18th Sep 2015 21:43
No, i mean like this:



It returns:
Cannot perform operation "BitWise XOR" on data type "String"
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Sep 2015 23:07 Edited at: 18th Sep 2015 23:10
should be this

string1$ = "a"
string2$ = "b"
if asc(string1$) ~~ asc(string2$)

i think xor with a 2 strings need at least the same length.
so this can't work
if (string1$ = 'a' ~~ string2$ = 'bdsfdsf')

AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 18th Sep 2015 23:12
I want it to be either value, not each other?
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 18th Sep 2015 23:50
Of course. Bitwise operations on a string don't make sense anyway. If you really wanted to do it you should convert each char to int and xor that.

Login to post a reply

Server time is: 2024-09-29 05:29:04
Your offset time is: 2024-09-29 05:29:04