Something interesting about Templates

I’ve been watching you all for about 10 minutes now- how can I help?

1 Like

Explain this.

Could you explain to me tomorrow, I gotta go to bed, you can write it now and I’ll read it tomorrow though. I’m on the fringe of getting yelled at!

I quoted him one too many times…
he got notified.

2 Likes

Okay, but…
I gotta ghost!
I’ll be more than happy if you can explain it to me tomorrow!
(or now and I read it tomorrow…)

So A is a variable that is either true or false.
When you multiply A by 1 you get either 1 or 0. If A is true, then 1xA is 1. If A is false, then 1xA = 0.

This happens because of JavaScript and some weird rules that the programming language has. Make sense so far?

1 Like

No please explain again
im just wasting ur time lmao

1 Like

Wait, is A defined or doesn’t have a value?
(This is attracting alot of users)

Not really. Why’d we multiply a by 1 in the first place?
(duh Blackhole is talking)

Two users.

I see that, Pimysz. Time-waster.

Oh, heck, I have a bloody nose.

I know what you are
I know who you are
Follow what you promised to do

3 Likes

A is equal to either true or false in this case.

I developed this code to check if two conditions are true/false, or false/true respectively. Basically, the check is supposed to pass if
A = true, B = false
A = false, B = true
But it won’t pass if
A = true, B = true
A = false, B = false

3 Likes

me too.

1 Like

Hold up I’m gonna hop on computer so I can explain with higher typing speed

1 Like

So this is like an OR conditionn?

Fine.

Even though I never did.

I get to visit, though.

Ok, this makes more sense now. Like a logic gate. Keep going.

Sorry guys, my internet’s going wonky, I might have to log off, but you can keep up the discussion, I can’t wait to see where you guys will leave off of!

I’m also going to get yelled at if I don’t go to bed!

Yeah, I’ve got some extreme loading going on, too, so I’m going to hop off.

Who knows when I’ll be back.

Almost- it’s called an XOR gate. Here’s the chart for it.
image

Anyway, we have two variables, A and B. A and B are either true or false. We want to do an XOR operation on A and B. First, we convert A and B into numerical values by multiplying by 1. When we multiply a true/false value by 1 it is converted into a 1 or 0 depending on whether it’s true or false. (true * 1 = 1, false * 1 = 0).

From here, we just add these numbers we get together, and check if they equal 1. If they equal 2, then both were true. If they equal 0, neither were true. If they equal 1, then one was true and one was false and the XOR gate’s conditions are fufilled.

2 Likes