Problem description:
What's the easiest/most efficient way to get the opposite of a given direction?
My bit-manipulation is really rusty.
ID:2250395
May 24 2017, 9:33 am
|
|
May 24 2017, 9:35 am
|
|
turn() is the workhorse for sure. The time to use bitflags is when you need to do something with cardinal-to-diagonal or diagonal-to-cardinal conversion, detection, or something along those lines. Or if for instance you have a turf that can't be entered from certain directions, that's a time for bitflags. Autojoining is also best handled with bitflags.
|