Visualize what I say and you will surely hit your target as soon as possible. Since you do not need to think about the full 360 degrees, but you can take half of this and use the differences of the signs to your advantage.
Take a look at this figure: 
We have a circle divided into two sides (left and right).
The left side will take a negative 180 degrees. (West side).
The right side will take a positive 180 degrees. (East side).
Current positioning will always be 0 as (North) and positive 180 as (South).
IF the compass is going positively (this means that it is going in the right direction)
Then add +1 for each revolution.
IF the compass is negative (value goes to the left).
Then subtract -1 on each revolution
IF the compass is in OR equal to 0, then this is the current position (NORTH).
IF the compass hits OR equals 90, then it (East).
IF the compass hits OR equals 180, then it (south)
IF the compass hit OR is -90, then it (West).
It turns out that whenever a person goes to the East, the counter will add +1 to 180, then it will change from positive to negative, which will subtract -1 on each revolution until it reaches 0. This will be a full rotation of 360.