Board Logo
« BB___LogicalOperators »

Welcome Guest. Please Login or Register.
Sep 25th, 2017, 7:05pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: BB___LogicalOperators  (Read 1479 times)
tsh73
JB-Supporter


member is offline

Avatar




PM

Gender: Male
Posts: 3553
xx BB___LogicalOperators
« Thread started on: Oct 5th, 2010, 07:25am »

Hello all,
I was adding examples for BB___LogicalOperators page.
Examples for NOT, AND and OR came quite easily - everybody encounter them in real life, and they are quite common in programs.
But I have no idea about meaningful example for logical XOR operator. I've tried to search Internet and asking people near me - but cannot find any.

So may be someone knows some example?
I dunno, may be in some game rules?
User IP Logged

Q: "And if I took your codes and compile them, and sell them for a profit"?
A: Go ahead. I had my share of good then I coded it for fun, if you can make better use of it - please do.
(enjoying JB 1.01 on WinXP, netbook and desktop)
tenochtitlanuk ( John F)
Full Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 421
xx Re: BB___LogicalOperators
« Reply #1 on: Oct 5th, 2010, 11:14am »

My main uses are for toggling bits on interfaces, and of course the
#handle, "rule rulename"
... which allows XOR plotting and thus erasing existing drawn lines.
Perhaps Code:
if hungry XOR foodGoodToEat then gosub [starve] 
User IP Logged

Visit my LB/JB pages at http://www.diga.me.uk/index.html
I use XP and Ubuntu Linux on old machines!
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3705
xx Re: BB___LogicalOperators
« Reply #2 on: Oct 5th, 2010, 3:28pm »

A simple example of using the XOR operator would be a LED display of eight LEDs.

You can toggle LEDs on with AND and off with XOR.
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
tsh73
JB-Supporter


member is offline

Avatar




PM

Gender: Male
Posts: 3553
xx Re: BB___LogicalOperators
« Reply #3 on: Oct 6th, 2010, 01:42am »

Stefan, I think I did pretty sound job explaining bitwise operators in this page. It even looks more like a tutorial wink

But my question was about example for using XOR in condition checking (IF and stuff).
And it seems that it's rather hard to find.
User IP Logged

Q: "And if I took your codes and compile them, and sell them for a profit"?
A: Go ahead. I had my share of good then I coded it for fun, if you can make better use of it - please do.
(enjoying JB 1.01 on WinXP, netbook and desktop)
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3705
xx Re: BB___LogicalOperators
« Reply #4 on: Oct 6th, 2010, 03:57am »

I never needed XOR in a condition, I only used it to inverse bits.

I even can't think of a situation where a XOR condition would be needed.

Even a simple XOR en-/decryption does not use it in a condition.

For some things you will never find an example wink
« Last Edit: Oct 6th, 2010, 03:57am by Stefan Pendl » User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls