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.

DarkBASIC Discussion / Forgot something simple please remind me

Author
Message
ironhoof
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 29th Jan 2003 00:34
Bitwise XOR operator so I can invert things =P I forgot what it was in DB I don need it very ofen so im in a rut.


How do I go aboutmakin one if there isnt one, I think I remember something about yo had to make the XOR operator
-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 29th Jan 2003 00:36
what does it do exactly, that XOR operator?

ironhoof
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 29th Jan 2003 00:42
XOR inverts


1 xor 0 is 0
1 xor 1 is 0
0 xor 1 is 1 (Er somethng like that) might be 1 xor 0 is 1
0 xor 0 is 1

-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
ironhoof
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 29th Jan 2003 00:43
except the REAL xor operator inverts number greater than 1 :0 to the opposite number on the other end of the scale depending on what your exclusive oring it with

-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 29th Jan 2003 03:55
DB didn't have it remember

what you have to do is the lame mans version

Result = Value * (MaxValue / Value)

so a pixel being 0-255 the MaxValue would be 255 ... if you include negatives as positive and minus numbers then you just do MaxPosition*2

the result should be the opposite end, but my math is oftenly aweful

Anata aru kowagaru no watashi!
Epidemicz
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 29th Jan 2003 04:44
Why is it in my DBPro manual if it doesn't work? The syntax even highlights when I type it it.....are they going to make it work?

I am the very disease you pretend to be.
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 29th Jan 2003 13:45
because this forum is about DB and not DBpro I guess...

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 29th Jan 2003 13:46
lame mans hehe layman i think u r looking for but thats excellent also jeje

HAL
22
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 29th Jan 2003 22:08

it was a magic moment when i learned what this did not so long ago but then i am mad.
http://static.howstuffworks.com/boolean1.htm
HAL
22
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 29th Jan 2003 22:12
this link might be better..
http://www.howstuffworks.com/boolean1.htm
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 30th Jan 2003 12:18
hehee ... that tends to happens when i'm doing 10things at once

you know i haven't a clue if its right now not - i'm kinda sure it is, but not 100%
you kinda get lazy when you have !! and ||

Anata aru kowagaru no watashi!
CaiF_R
22
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 2nd Feb 2003 15:50
Basically in algebra language the XOR is "not or"
It can also be used in conjunction with other algebra expressions like AND so that´ll be XAND.
The X is an inverter

And ex. could look like this
IF blablabla1=1 XOR blablabla2=1 then hmm=1

A on/off chart of OR would look like this then:
0 OR 0 =0
1 OR 0 =1
0 OR 1 =1
1 OR 1 =1

... And an inverted version (XOR)
0 XOR 0 =1
1 XOR 0 =0
0 XOR 1 =0
1 XOR 1 =0

Cheers

CaiF_R
22
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 2nd Feb 2003 15:51
Typo!
IF blablabla1=1 XOR blablabla2=1 THEN hmm=0

CaiF_R
22
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 2nd Feb 2003 16:02
Arr!... This is confusing.
I´ve just checked out the url u mentioned, HAL.
It seems to me that N is an inverter and X is... well i donno) Exclusive or something like that (what ever that means) The most confusing part is that u can even mix the two so u´ll end up with XNAND XNOR... Wow iam getting dizzy!

Cheers

Login to post a reply

Server time is: 2025-08-08 11:45:05
Your offset time is: 2025-08-08 11:45:05