This is an old revision of the document!
H04. Final homework
For the final homework, you may choose between two options:
- A. Lab homework (0.5p). All students which did not submit Homework 3, (submitted a solution which did not compile or got under 30p), may choose this homework. The maximum number of points that may be achieved is 0.5p. See details below.
- (B) Tic Tac Toe part 2 (1p). All students which submitted Homework 3 or a consistent part of it may choose this homework. See details below.
A. Lab homework (0.5p)
The lab homework consists in providing complete solutions to labs 4, 5, 6, 9 and 10, except for exercises marked with (!).
- Each completed lab will be graded with 0.1p
- There will be no partial points for partially solved labs - each lab has to be entirely complete to be graded.
- Solutions will be presented live and graded during lab - no solutions sent by email or MS Teams will be graded.
- Solutions should be solved 100% individually. If some exercises or parts of them are taken from other sources, the entire homework will not be graded.
- Deadline: Friday 27 May
B. Tic Tac Toe part 2 (1p)
Option B. for Homework 4 consists in developing a complete Tic Tac Toe game, together with an AI and a very basic interface.
- For this stage, you will decide on the structure of your project, as well as write tests to guide your implementation.
- There are three parts of this homework, which will be evaluated independently;
- The evaluation will take into account your working code, AS WELL AS THE TESTS THAT YOU WRITE (If you write insufficient tests, an otherwise working code may not be graded).
- There will be no other partial points, other than those mentioned explicitly in the statement.
B.1. Board analysis (0.2p)
For this part, you need to implement a function sequences
, that returns a list of 4 pairs of the form: (a,5), (b,4), (c,3), (d,2)
where:
a
is the number sequences of length 5 that the player has establishedb
is the number of sequences of length 4 which can be filled-out in order to achieve a 5-sequence. For example:XX XX
is such a sequence for playerOne
, howeverXX0XX
is not, since this cannot be filled-out in order to achieve a 5-sequence.c
(resp.d
) is the number of sequences of length 3 (resp. 2) which can be filled-out in order to achieve a 5-sequence.
def sequences(p: Player)(b: Board): List[(Int,Int)] = ???
B.2. Functionality (0.35p)
B.3. Game AI (0.45p)
- Very basic, but functional AI: 0.1p
- Intermediate AI (which may win in some cases): 0.2p
- Minimax-based AI 0.45p
0.2p bonus for the best AI, which will be established in a competition during lecture.