getDirection method
Implementation
String getDirection() {
var dir = x ~/ 90;
switch (dir) {
case 0:
return 'south';
case 1:
return 'west';
case 2:
return 'north';
case -1:
return 'east';
}
return 'north';
}