Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
DT211C-1 Team Computing
Worksheet 10 -12 - Algorithms
Learning Outcomes
On completion of this lab you will have:
1. Practiced the basics of GIT and online Repositories.
2. Worked on the Gyro Sensor and other sensors.
3. Uploaded a set of files and a README to your GIT repository.
4. Worked on more complex algorithms for position
Organisation
You should work with your teammate to complete this LAB and a single team submission should be saved. Each
student will be allocated an individual mark.
1 Overview
1.1 Grading
This worksheet will be graded by your lab supervisor using the marking scheme outlined in this document. This
week there is no theory component.
1.2 Submission
1. All source code and text files should be submitted via GIT using a private repository in BitBucket. Marks
will be awarded for programs that are well commented, well-structured and neatly presented, as well
as for those that perform as specified in the lab sheet.
2. This is a three-week lab. All source code should be committed by the end of the third lab.
1.3 Demonstration
You will give a demonstration of your submission to the lab supervisor in the week following your submission.
You will be asked to go through the answers in the README. To receive your marks, you must be present at the
demonstration.
1.4 Requirements
For this lab you will need to
1. Continue to use your Bitbucket private REPOs
2. Use the ROBOTC language reference guide as required:
http://help.robotc.net/WebHelpMindstorms/index.htm#Resources/topics/Welcome.htm
3. Use GITBASH on the PC
1.5 Resources
You are free to research whatever you need to solve the problems in this lab however plagiarism is not tolerated.
2 Part A
Before you start this section, you should do the following:
1. Make a new subdirectory /Lab10 in your own repository
2. Sign out a robot with your partner
2.1 Practical Components [100%]
1. [15%] Using the Playfield -> Set coloured tiles command, recreate a similar environment to that shown
in figure 1. Test using a number of colour combinations for the tiles, as they will be assigned at random
during the demo (the locations won’t change). Write a program called Lab10Colors.c for the robot to
visit each tile, display the colour to the screen and flash a different LED colour on the brick.
• 9 marks for completing the task
• 3 marks for code efficiency and reuse
• 3 marks for comments and quality of code/structure
Figure 1 – colour tile layout for question 1.
2. [10%] Modify the program from worksheet 7 locationfinder.c so it is now team-
computing/lab8/locationfinder2.c. Start the robot position in [3,1 ] (pointing forward) using an X,Y
coordinate system, the robot will drive to map position 3,7 and stop facing the forward direction.
• 5 marks for completing the task
• 2 marks for code efficiency and reuse
• 3 marks for comments and quality of code/structure
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
Start
3,7
3. [15%] Write the program teamcomputing/lab8/locationfinder3.c. Start the robot position in [3,1 ]
(pointing forward) using an X,Y coordinate system, the robot will drive to map position 3,7 where it will
stop for 5 seconds while beeping, before then travelling to point 1,1 where it will then stop.
• 9 marks for completing the task
• 3 marks for code efficiency and reuse
• 3 marks for comments and quality of code/structure
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
Start
3,7
Finish
4. [15%] Write the program teamcomputing/lab8/challenge1.c. Where you tell the robot the starting X,Y
position (pointing forward) when the program starts, and make it drive to position [5,5]. You should
test the following starting points:
Position [1,1]
Position [5,5]
Position [6,6]
Position [1,6]
Make sure you cannot put in any negative values.
• 10 marks for completing the task for destinations 1-4
• 3 marks for code efficiency and validation of negative values
• 2 marks for comments and quality of code/structure
2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
5,5
1,1
Finish
1
1,6
6,6
5. [20%] Write the program teamcomputing/lab8/challenge2.c. Where you tell the robot the starting X,Y
position (pointing forward) when the program starts and then input into the robot the destination in
X,Y coordinates. You should test the following starting point and ending points
Position [1,1], [5,5]
Position [5,5], [1,1]
Position [6,6], [1,6]
Position [1,6], [7,1]
2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
5,5
1,1 1,6
6,6
7,1
1
6. [25%] Write the program teamcomputing/lab8/challenge3.c. Where you tell the robot the starting X,Y
position (pointing forward) when the program starts and then input into the robot the destination in
X,Y coordinates. In this case the robot should be able to detect an object in the way and initiate an
algorithm to go around it. The object will only occupy one square an cannot occupy the starting and
ending square. You should test the following starting point and ending points, you will be asked to demo
two at random.
Position [1,1], [5,5]. Objects in position [5,1] and [1,5]
Position [5,5], [1,1]. Objects in position [5,3] and [2,5]
Position [6,6], [1,6]. Objects in position [1,4] and [6,4]
Position [1,6], [7,1]. Objects in position [3,6] and [4,1]
Each program above will be graded for
Functional Completeness.
Code structure, comments, functions, code quality and neatness
Teamwork and sharing of the work