If you are looking for a replacement for tri-state bool with int, you can always have a nullable boolean without worrying about standards. Something like in C # bool? triState bool? triState . It may be true, false, or null, which may be considered unknown, but I see that not what you are looking for.
I do not know about the convention. Most likely not from the answers given here. I like your third.
But another perspective, my choice:
{ True, Unknown, False } => 0, 1, 2
EDIT: After a good point from @LarsTech, I have to clarify. If I know that a variable can have more than two values, I would think that it is an enumeration of it, and therefore I could translate it to {0, 1, 2}. I always follow the pattern for enumeration values ββlike this: "Good, good, poor." This is natural for me, but for many, true β0β is not welcome. You can always have the reverse order.
source share