List of tutorials

Find detailed help from the AAO community, or write your own tutorials.

Moderator: EN - Forum Moderators

User avatar
Singapore123
Posts: 2085
Joined: Wed May 05, 2010 8:56 am
Gender: Male
Spoken languages: English, 1337, french, spanish,

Re: List of tutorials

Post by Singapore123 »

Saw the tips and tricks, but still wanted to know: Is it possible to use variables to check if and ONLY if 1 input is on. 2 inputs is easy, make those (NOT,AND,OR) gates into a XOR gate, but I want it to be like 3-5 inputs. So if one and ONLY one input is on, the output is on. If no easy way, I will have to go back to minecraft and make some logic gates...
User avatar
Bad Player
Posts: 7228
Joined: Wed May 20, 2009 10:53 pm
Gender: Male
Spoken languages: American
Location: Under a bridge

Re: List of tutorials

Post by Bad Player »

You mean, you want it to check if one and only one variable is true? It's kinda long, but you could use

(var1 & !var2 & !var3 & !var4 & !var5) | (!var1 & var2 & !var3 & !var4 & !var5) | (!var1 & !var2 & var3 & !var4 & !var5) | (!var1 & !var2 & !var3 & var4 & !var5) | (!var1 & !var2 & !var3 & !var4 & var5)
User avatar
Singapore123
Posts: 2085
Joined: Wed May 05, 2010 8:56 am
Gender: Male
Spoken languages: English, 1337, french, spanish,

Re: List of tutorials

Post by Singapore123 »

That's the simplest one, but I can try to make it smaller, but thanks!
User avatar
Meph
Posts: 13439
Joined: Mon Nov 10, 2008 10:07 pm
Gender: Male
Spoken languages: English
Location: Probably Disneyland Paris... or the UK

Re: List of tutorials

Post by Meph »

Post questions in their own topic in future, please, Singapore. :)
User avatar
henke37
Security expert / tools programmer
Posts: 3031
Joined: Wed Mar 04, 2009 9:42 pm
Gender: Male
Spoken languages: Swedish,English
Location: Sweden
Contact:

Re: List of tutorials

Post by henke37 »

Add them up and check if the result is exactly one.
Currently working on a redesign of Court-records.net.
User avatar
Bad Player
Posts: 7228
Joined: Wed May 20, 2009 10:53 pm
Gender: Male
Spoken languages: American
Location: Under a bridge

Re: List of tutorials

Post by Bad Player »

henke37 wrote:Add them up and check if the result is exactly one.
I almost wrote "although henke might have a more elegant solution" at the end of my previous post :P
User avatar
Singapore123
Posts: 2085
Joined: Wed May 05, 2010 8:56 am
Gender: Male
Spoken languages: English, 1337, french, spanish,

Re: List of tutorials

Post by Singapore123 »

Great Idea!
Post Reply