Professional Documents
Culture Documents
CO1401 2018-19 Assignment v2
CO1401 2018-19 Assignment v2
Assignment: Maps
Introduction
It is important to acknowledge sources. The initial idea for this assignment was taken from one
created by Baker Franke.
This assignment deals with a height map. This is a map showing height of a geographical area. This
type of map can be used to represent terrain. It depicts the terrain using a grid, with each location of
the grid ascribed a height.
Much of the assignment is based on tracing the path a person should take if they walked over the
map. For example, you are asked to calculate the mountain path across the map. Later parts of the
assignment also include manipulating the map, flooding it with water, and find the best route up a
mountain.
However, the assignment starts with reading a sequence of numbers from a file into an array and
then displaying these numbers.
The assignment is separated into separate grade bands. Complete in full the goals of the lower
grade band before moving onto the next.
Do not diverge from the assignment specification. If you do not conform to the assignment
specification then you will lose marks.
Demonstration
You must demonstrate your program to your practical tutor.
You must also show your code to your tutor.
You will be asked questions about your code. Be prepared to answer them. You may be asked
to explain what is happening, or to describe what a line of code does. If you cannot answer
satisfactorily then you will be asked to attend an interview with the module tutor.
Resources
This assignment has an associated set of text files. The files can be found inside the assignment
folder Web-CT.
Map Format
Each of the files represents one height map of a region.
The numbers are listed on 9 lines, with 9 integers per line.
In effect the numbers are sorted into a 9 x 9 grid.
The file will therefore list 81 numbers.
The maps are always 9 by 9.
The later parts of the assignment mention coordinates. The coordinates merely identify the
particular square. The coordinates are given in the form: row, column (if it helps you can
alternatively think of them as x and y).
( 0, 0 ) would be the bottom left hand corner.
( 8, 8 ) would be the top right hand corner.
( 8, 0 ) would be the top left hand corner.
( 4, 4 ) would be the centre square.
Note that we count from 0.
Hint: counting from 0 will help with the indices in the array. However, if you simply read the
map into an array the indices will not correspond to the coordinates, e.g. index [0][0] in a 2D
array will not correspond to the coordinate (0, 0). My suggestion is to read the map into a
temporary array and then copy it into another array, reversing the map as you do, it will make
later parts of the assignment much easier.
Assignment Requirements
Note that this version is coloured so that can see the relative heights more clearly. I
am not expecting to see a coloured table!
The other additional elements for this grade concern code style and layout:
No use of global variables.
Note the way that the locations along the bottom haven’t been filled with water even though
they are lower than 300. The reason for this is that they are not directly connected to the lake.
The locations in seventh row act effectively act as a wall.
Hand In Details
The hand-in deadline is Sunday 31/03/19, Midnight.
Submissions should be made via the link on the module Blackboard page
Submissions are automatically checked for plagiarism by TurnItIn
Ensure your name and student ID is stated at the top of your code.
You may only submit one file:
o Upload a text file with your code in it. This file should contain all your code for the
assignment.
o Ensure that your code just runs without the need to modify it.
You will demonstrate the code in your normal lab in the week of the assignment deadline, i.e.
i.e. the week beginning 01/04/19.
CO1401 Assignment 2018-19 Gareth Bellaby Page 5
The same rules of lateness apply to the demonstration as to handing in your work. If you do
not turn up to demonstration then your assignment will be treated as late.