Sha256: 211474c39b2fe9fc66903bd6ac63eca86c47b7f9d85ca1e0143ebe6baf018607
Contents?: true
Size: 893 Bytes
Versions: 34
Compression:
Stored size: 893 Bytes
Contents
#ifndef _ROBOT_SIMULATOR_H #define _ROBOT_SIMULATOR_H typedef enum { Heading_North = 0, Heading_East, Heading_South, Heading_West, Heading_Max } Bearing_t; enum { Default_Bearing = Heading_North, Default_X_Coordinate = 0, Default_Y_Coordinate = 0, }; enum { Command_Left = 'L', Command_Right = 'R', Command_Advance = 'A' }; typedef struct RobotCoordinates { int x_position; int y_position; } RobotCoordinates_t; typedef struct RobotGridStatus { Bearing_t bearing; RobotCoordinates_t grid; } RobotGridStatus_t; RobotGridStatus_t robot_init(void); RobotGridStatus_t robot_init_with_position(int bearing, int x, int y); void robot_turn_right(RobotGridStatus_t * robot); void robot_turn_left(RobotGridStatus_t * robot); void robot_advance(RobotGridStatus_t * robot); void robot_simulator(RobotGridStatus_t * robot, const char *commands); #endif
Version data entries
34 entries across 34 versions & 1 rubygems