Okay so this is a more serious post than I generally tend to make, this is about the discussion of something I did and also one question, has anyone ever implemented logical gates (AND, OR, XOR, etc) inside of PB2? and of course, I did, but I would guess someone probably has done it before (I believe this has been possible for a long time, the method I executed involves using doors and regions and moving the regions in the X axis (I believe this was added in 2013, but I could be wrong) and a few other features, the map uses other more modern features but such are not required, and not a single variable, to calculate the sum of two numbers in binary, which is actually what your computer does.
There are other methods to do this (enemy positions, doors in a more developed way), if one can execute the NAND gate inside of PB2 I believe all of the gates should be executable, anyway, here is the map:
https://www.plazmaburst2.com/?s=9&a=&m= ... id=1013127
It is open source but the functioning is not that hard to understand, first, what is a computer? what I made is not Turing complete, but adapting what I created into being Turing complete is possible, but if you take the Google definition of computer: "an electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program.", I do believe it passes this.
First, what is binary? instead of the fancy 10 number basis, we work with 2, 0 is 0, 1 is 1, 2 is 10, 3 is 11, 4 is 100, 5 is 101, 10 is 1010 and so on, the formula is: decimal = d0 * 2^0 + d0 * 2^1 + d0 * 2^2 + d0 * 2^x... infinitely, d is digit, to convert a binary number into decimal, to convert a decimal number into binary, you divide it by two, take the quotient and write down the remainder, the example for the number 13: 13/2 = quotient of 6, remaider of 1. 6/2 has a quotient of 3 and a remainder of 0, 3/2 has a quotient of 1 and a remainder of 1, 1/2 has a quotient of 0 and a remainder of 1, the remainders are 1 0 1 1, 13 on the base of 10 is 1101 on the base of two (binary), 1101 is 1*2^3 + 1*2^2 + 0*2^1 + 1*2^0 = 13.
Your computer does everything in binary because it is easier to work with, why? because it uses capacitors, which gets into the magical field of digital electronics, ever seen these fancy circuits? well, turns out you can do that not only with capacitors, but with everything, even dominos, and also doors, in my map I only executed the AND and the XOR gates, why? because with them you can create the half adder with them, which happens to be the preview of my map, here is the half adder:
At the top we have the XOR gate, simbolized by the )D thing, and at the bottom we have the AND gate, which is the D, and the two inputs, A and B, the idea of XOR is that it is X OR, if A or B are 1, it is true, but only if it is one (that is why it is the OR), so here is the logical table for it:
A = 0, B = 0 -> XOR = 0
A = 0, B = 1 -> XOR = 1
A = 1, B = 0 -> XOR = 1
A = 1, B = 1 -> XOR = 0
The AND gate is very simple, if both A and B are 1, it is true, so 1, the logical table for it:
A = 0, B = 0 -> AND = 0
A = 0, B = 1 -> AND = 0
A = 1, B = 0 -> AND = 0
A = 1, B = 1 -> AND = 1
If you have a slighty working brain you probably got the idea, the half adder S is the sum, and the C is the carry, just like when you do 5+5 which passes 1 to the next digit and 0 to the current, this also happens in binary, turns out you can do sums with this, and that is what the map does!
So let's first see what the circuit does:
It's a bunch of half adders, that calculates the sum of digits, since we are working in binary, one half adder can sum one digit, the next one another, and so on, 2^n, there are 5 half adders, so 2^5 which is 32, but the max value for the sum is 31, because 0 is also a number to be considered here, but since the input is limited by 4 digits, 4 instances of A and B, the maximum input is 15, and the lowest one is 0, now take a look at the map and it's source:
You can see which gate is which, and how they are connected (not necessary, I did this so it is easier to understand), all it does is move the region to the right based on the truth tables, it adds 100 to the X size of the region, and the door moves there, there is a region under there that activates stuff related to the next gate and so on, it adds 100, for the XOR gate, since it will only run if only A or B are 1, when it is at 100 it will run, but when it hits 200 it will not, so it is a 0, the AND is the opposite, if it only moves 100 it will not run, but if it moves 200, both A and B being true, it will activate the next one as true.
The input digits are just doors so you can save their values, you activate the triggers on the right to move them to the right (1), and the ones on the left to move them to the left (0), the USE button on the far left of the map runs the whole circuit.
So let's see it in practice:
12 + 13 = 25, right? let's do this, 12 in binary is 12/2 = 6 (0), 6/2 = 3 (0), 3/2 = 1 (1), 1/2 = 0 (1), so we get 1 1 0 0, so 12 = 1100, 13 as we know is 1101, 25 is 25/2 = 12 (1), 12/2 = 6 (0), 6/2 = 3 (0), 3/2 = 1 (1), 1/2 = 0 (1), so 11001.
So 1100 + 1101 or 1101 + 1100 should be 11001, what happens if you run it?
So yeah, did I mention this uses literally no variables? yeah, that is the thing, this is what is happening in your computer, not the same exact thing in the same exact way, but the principles are the same.
A few things I did not mention, the XOR gates marked with II could be OR gates, in real life the OR gate is cheaper to manufacture since the XOR one uses 6 capacitors and the OR uses only one as far as I know, so yeah there is that, but in PB2 with the system I created, the XOR is easier, so I went with it, you could execute this in a different way literally creating the logical table with the movable objects and such, but this was simplier for me to do and it gives a good idea of the concept.
Anyway, why did I make this post?
The general idea is that, I don't have the time to really play with this, and this is actually very interesting and useful if you have the brains for it, this can be executed super fast in a small scale and if someone creates the other logical gates (I might do this later), you can have any circuit in the game, there are a few other issues but these can be dealt with, this really shows how amazing PB2 is as a game and how far it goes in it's system, and what I find most impressive is that this could've been done in the past, so again, has anyone done this? I really think someone might have, this is a quite well known about topic and it has been possible for a while.
Anyway, there is more to be discussed, if nobody has ever made this, isn't this kind of sad? other games with more mature communities such as Factorio have done things such as this, I mean the PB2 target audience are obviously kids, so this explains this, but isn't it sad? anyway while the game got easier to do things, I think it lost one of it's charms, the difficulty in executing this, this could've been much more developed if some random dude in 2013 did this and people learned it and executed variables, in such case, the updates with variables probably wouldn't have happened, and if it did it would probably be earlier, this applies to everything, I made that image insertion program (the original version was bad but still), the image decors were added, what if someone did that before? I think people are very limited by what they see and not the opportunities this game has, this is something you can execute in very few games and it is amazing.
Also I think General Discussion is better than either Tutorials or Maps because... it is not really a Tutorial, and not really a Map, it is both, but more of a general discussion about the topic.
tldr: you can create fancy nerd stuff in pb2 to like calculate things without using variables, basically, make a computer, this topic gives a brief introduction to the topic and some commentary
Also if anyone has done this in the past please let me know!!!