summaryrefslogtreecommitdiff
path: root/turtle.h
blob: bac955703139455894818179da1bd6e5add8187a (plain)
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
#ifndef TURTLE_H
#define TURTLE_H
/*directions, CCwise like on a coordinate plane */
#include<stdio.h>
#include<unistd.h>
#define RIGHT 0
#define UP 1
#define LEFT 2
#define DOWN 3
/* map everything is held in
 */
char map[20][20];
/*turtle positions */
extern int tx;
extern int ty;
/*turtle direction*/
extern int td;
/* loads map from file, returns any IO errors, assumes map is 20x20 ascii
 * chars
 * this does the first printing of the screen
 */
extern int loadmap(char * filename);
/*movement of the turtle*/
extern void go(int blocks);
extern void turn(int direction);
void printmap();
#endif