This module investigates declarative programming using the functional programming language Hope.
1. A bacterium with 2 or 3 neighbours survives from one generation to the next. A bacterium with fewer neighbours dies of isolation. One with more neighbours dies of overcrowding.
2. An empty cell spawns a bacteria if it has exactly three neighboring cells which contain bacteria.
Using a representation of the board as a list of lists, write a hope function: generate, which given any starting position, produces the next generation. (10%)
Bonus marks of up to 10% (of the total unit mark) will be given for the generality of your solution.
Write a function which takes a board and produces all
possible positions that can be produced in the next
move.(15%)
Bonus marks up to 15% will be given for the generality
of your solution and for making up some of your own
relevant and interesting functions.
Write a hope function which takes three parameters: a
representation of the map, the first station and the last
station and outputs all cycle free routes (a route is a
list of stations) between the first and the last station. (20%)
Bonus marks up to 20% will be given for making up some of
your own useful functions.
Coursework 2: Noughts and Crosses
Think of a way of representing a Noughts and Crosses
(Tic Tac Toe) board in Hope.Coursework 3: A Journey Planner
Give a Hope representation for the London Tube Map.
Go To:
Eamonn's Place
: Education