Foundation Year Module


Exercises for the Foundation Year Module:

Semester 1

Exercise 1

Variables and calculation Mark Sheet: ex1

Exercise 2

Calculation and drawing Mark Sheet: ex2

Exercise 3

Conditionals and loops Mark Sheet: ex3

example of Q5, matrix effect: matrix.mp4

Semester 2

Week 1 lab exercises

Example code: grid of points and draw two eyes on the screen

Model solutions: The grid of points where each point is twice as far away, Hexagon "grid" (not a perfect solution), and Scalable pairs of eyes (again, this could be improved by doing the scaling manually instead of using scale()).

Exercise 4

Functions and Recursion

Model solutions: Binary search over an array. This is the same idea as the root-finding question in Exercise 5, but applied to an array of integers, rather than a continuous range.

Exercise 5

More Recursion, and Pong!

Model solution code

Exercise 6


An example level file