Thread history
Viewing a history listing
Time | User | Activity | Comment |
---|---|---|---|
21:53, 16 December 2013 | Sheldor (talk | contribs) | New reply created | (Reply to Logical Question) |
21:47, 25 June 2013 | Skilgannon (talk | contribs) | New reply created | (Reply to Logical Question) |
21:41, 25 June 2013 | Sheldor (talk | contribs) | New reply created | (Reply to Logical Question) |
21:03, 25 June 2013 | Skilgannon (talk | contribs) | New reply created | (Reply to Logical Question) |
20:29, 25 June 2013 | Sheldor (talk | contribs) | New reply created | (Reply to Logical Question) |
19:59, 25 June 2013 | Skilgannon (talk | contribs) | New reply created | (Reply to Logical Question) |
18:58, 25 June 2013 | Sheldor (talk | contribs) | New reply created | (Reply to Logical Question) |
18:02, 25 June 2013 | MN (talk | contribs) | New reply created | (Reply to Logical Question) |
16:20, 25 June 2013 | Sheldor (talk | contribs) | New thread created |
Is there any kind of bit operation or arithmetical trick that would allow me to do something like integerWhichCouldOnlyHaveAValueOfZeroOrOne == 0 ? otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne == 0 ? 0 : 1 : 2
without so many expensive conditionals?
Like this?
integerWhichCouldOnlyHaveAValueOfZeroOrOne | otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne + integerWhichCouldOnlyHaveAValueOfZeroOrOne
If there is no possibility that integerWhichCouldOnlyHaveAValueOfZeroOrOne == 1
and otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne == 0
, or if you don't care, then a simple addition would work.
There is a chance that the first and second integers would add up to 1 in two different scenarios. I do care to avoid this because I was planning to use this in VCS segmentation. It would not be prudent to represent two very different situations by the same segment.
If you're using it for wall segmentation, it should be fine just adding. The chances of the closer one being triggered but not the further is quite rare (although it can happen, I admit).
If both wall checks be either 1 or 0 at the same time a vast majority of the time, what's the point of even having a second wall check?
Hang on, is this two forward wall checks, or one forward and one reverse?
I was thinking two forward, where obviously the check which extends further will also be triggered in 99% of cases where the one that extends less is triggered.
If this is one forward, one reverse then I think they should actually be in different segments.