#import "GridTurtle.h"

#define __USE_FIXED_PROTOTYPES__  // for gcc headers
#include <stdio.h>


@implementation GridTurtle_c

- (void) move: (int) distance
{
  switch (direction) {
  case north: y_coord += distance; break;
  case east:  x_coord += distance; break;
  case south: y_coord -= distance; break;
  case west:  x_coord -= distance; break;
  }
}

- (void) turn: (int) angle
{
  direction = ( direction - angle ) % 4;
}

- (void) print
{
  printf( "x coord: %d  y coord: %d  direction: %d\n",
           x_coord, y_coord, direction );
}

@end
