-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobot.h
More file actions
39 lines (27 loc) · 734 Bytes
/
robot.h
File metadata and controls
39 lines (27 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef ROBOT_H
#define ROBOT_H
typedef struct robot{
int x;
int y;
int dir;
int carried_markers;
} Robot;
extern const int direction;
extern int task_finished;
void drawRobot(Robot *robot);
void randomInitRobot(Robot *robot);
void update(Robot *robot);
int canMoveForward(Robot *robot);
void forward(Robot *robot);
void left(Robot *robot);
void right(Robot *robot);
int markerCount(Robot *robot);
int atMarker(Robot *robot);
void pickMarker(Robot *robot);
void dropMarker(Robot *robot);
int isAtHome(Robot *robot);
int manhattanDistance(int x, int y, int home_x, int home_y);
void go(Robot *robot);
void goHome(Robot *robot);
void end(Robot *robot);
#endif // ROBOT_H