Sha256: df46088419bedc01c570b8598597fd7d70f41c1ff3dbc5f980a054e9e818ff2d

Contents?: true

Size: 891 Bytes

Versions: 201

Compression:

Stored size: 891 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

201 entries across 201 versions & 1 rubygems

Version Path
trackler-2.2.1.45 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.44 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.43 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.42 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.41 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.40 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.39 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.38 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.37 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.36 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.35 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.34 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.33 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.32 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.31 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.30 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.29 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.28 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.27 tracks/c/exercises/robot-simulator/src/robot_simulator.h
trackler-2.2.1.26 tracks/c/exercises/robot-simulator/src/robot_simulator.h