List of tutorials

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

Moderator: EN - Forum Moderators

Re: List of tutorials 

Postby Singapore123 » Fri Jan 13, 2012 8:51 am

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
Singapore123
 
Posts: 2085
Joined: Wed May 05, 2010 8:56 am
Gender: Male
Spoken languages: English, 1337, french, spanish,

Re: List of tutorials 

Postby Bad Player » Fri Jan 13, 2012 3:38 pm

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
Bad Player
 
Posts: 7213
Joined: Wed May 20, 2009 10:53 pm
Location: Under a bridge
Gender: Male
Spoken languages: American

Re: List of tutorials 

Postby Singapore123 » Fri Jan 13, 2012 3:52 pm

That's the simplest one, but I can try to make it smaller, but thanks!
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 

Postby Meph » Sat Jan 14, 2012 2:53 am

Post questions in their own topic in future, please, Singapore. :)
User avatar
Meph
 
Posts: 13439
Joined: Mon Nov 10, 2008 10:07 pm
Location: Probably Disneyland Paris... or the UK
Gender: Male
Spoken languages: English

Re: List of tutorials 

Postby henke37 » Sat Jan 14, 2012 4:37 pm

Add them up and check if the result is exactly one.
Currently working on a redesign of Court-records.net.
User avatar
henke37
Security expert / tools programmer
 
Posts: 3031
Joined: Wed Mar 04, 2009 9:42 pm
Location: Sweden
Gender: Male
Spoken languages: Swedish,English

Re: List of tutorials 

Postby Bad Player » Sat Jan 14, 2012 4:40 pm

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
Bad Player
 
Posts: 7213
Joined: Wed May 20, 2009 10:53 pm
Location: Under a bridge
Gender: Male
Spoken languages: American

Re: List of tutorials 

Postby Singapore123 » Sun Jan 15, 2012 6:13 am

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

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest