Something interesting about Templates

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

2 Likes

Explain this.

1 Like

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!

1 Like

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

3 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…)

1 Like

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?

2 Likes

No please explain again
im just wasting ur time lmao

2 Likes

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

1 Like

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

1 Like

Two users.

I see that, Pimysz. Time-waster.

Oh, heck, I have a bloody nose.

1 Like

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

4 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

4 Likes

me too.

2 Likes

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

2 Likes

So this is like an OR conditionn?

1 Like

Fine.

Even though I never did.

I get to visit, though.

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

1 Like

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!

1 Like

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

Who knows when I’ll be back.

1 Like

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.

3 Likes