nonsequitur·há 4 anos·discussNix is turing complete (it can implement the Lambda Calculus), even conveniently so.
nonsequitur·há 4 anos·discussThis doesn't work because you're not left-shifting (doubling) the carry. But when adding the shifted carry to (x ^ y) we're back to potentially overflowing the highest bits. The solution is to add the highest and the lower bits separately: lower = 0x7f7f7f7f; highest = ~lower; z = ((x & lower) + (y & lower)) ^ ((x ^ y) & highest); Note this only improves performance for larger container integers.
nonsequitur·há 10 anos·discussThere's no assignment to the „m“ variables that would make your algorithm work in the general case.im4w1l's strategy is just:Player i returns (i - [Sum of the other players' suits]) % 4(With i ranging from 0 to 3)