-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
46 lines (29 loc) · 873 Bytes
/
main.c
File metadata and controls
46 lines (29 loc) · 873 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
40
41
42
43
44
45
46
#include "graphics.h"
#include "robot.h"
#include "arena.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
setWindowSize(WIDTH,HEIGHT);
// randomly generate the size of the arena and the number of tiles
randomArena();
//intialise the tiles and home position
// The number and position of walls, obstacles, and markers are all generated randomly
drawBackground();
Robot myRobot;
Robot* robot_ptr = &myRobot;
// randomly generate the robot's initial position
sleep(1000);
randomInitRobot(robot_ptr);
sleep(2500);
// start the robot to explore the arena
// Level 1 : collect all markers
go(robot_ptr);
sleep(2500);
// Level 2 : return all markers to home
goHome(robot_ptr);
end(robot_ptr);
return 0;
}