Anyone ever wondered what the "Change" block's formula is? Well, here it is! It's actually really simple, so most people will already know it. Also, I wouldn't recommend actually using this in a project. Just use the change block, it's way more block-efficient. (mostly because it's already a block..)
look inside btw