Steam installeren
inloggen
|
taal
简体中文 (Chinees, vereenvoudigd)
繁體中文 (Chinees, traditioneel)
日本語 (Japans)
한국어 (Koreaans)
ไทย (Thai)
Български (Bulgaars)
Čeština (Tsjechisch)
Dansk (Deens)
Deutsch (Duits)
English (Engels)
Español-España (Spaans - Spanje)
Español - Latinoamérica (Spaans - Latijns-Amerika)
Ελληνικά (Grieks)
Français (Frans)
Italiano (Italiaans)
Bahasa Indonesia (Indonesisch)
Magyar (Hongaars)
Norsk (Noors)
Polski (Pools)
Português (Portugees - Portugal)
Português - Brasil (Braziliaans-Portugees)
Română (Roemeens)
Русский (Russisch)
Suomi (Fins)
Svenska (Zweeds)
Türkçe (Turks)
Tiếng Việt (Vietnamees)
Українська (Oekraïens)
Een vertaalprobleem melden
A+B=C output this shouldnt require 3 and gates to make one real and gate
If I understand correctly, I think it's more like:
"AND" = min(1, max(-1, (A+B+(...)))) * (abs(A)*abs(B)*(...))
"OR" = min(1, max(-1, (A+B+(...))))
"XOR" = (A * ((B == 0) * (...)) + (B * ((A == 0) * (...)) + (...)
I'm not sure if there's a standard for trinary logic; but basically what the game does is a sorta jerryrigged approach using floats (or maybe fixed point decimals, I'm not sure how they handle precision since there's no way to get a numeric readout) with math operations and in the case of XOR also comparison with zero (with True producing a 1, and False producing a zero). Or something equivalent to that.
the formula for the AND gate there is wrong because the output value is never multiplied by the output value of the inputs but rather by the output value of the gate. It would be correct if you were using the normal boolean algebra, but on that case you don't need the first part as it can be removed using the rules of boolean algebra. If you want to calculate the output value the absolute value of each input in the multiplications would need to be replaced with a different than 0 comparison. Additionally, all of those formulas are missing the output value being multiplied by the output value of the gate. While with those corrections the formulas would be correct, it's easier to think about the output value and the truthness value as separate things, which allows to simplify the formula for the output value to a single one common for all blocks and use the normal boolean definitions for the truthness value
the output value is stored as a float, however on practice over 99% of the time you won't use the extra precission values closer to 0 have, so you can think about them as fixed point decimals with 8 decimal places