Assignment 0

Deadline: Nov, 3 2023 14:00 CET

This assignment aims to help you get acquainted with the course set-up, the assignment workflow and, if need be, (re-)introduce you to Python.

Exercise

The task is to create a function that will make the most likely guess for a game of hangman. This guess will be informed by the letters that have already been tried and the most common letters appearing at positions where letters have not been guessed.

All code should be implemented in the provided template. The main method is already provided, as well as a sample lexicon that will be used for testing.

0.1 Implement guess_hangman()

Guess a letter, given the template, lexicon and guesses so far.

We try to implement a simple, heuristic-based hangman guesser. The idea is to match the most likely word in the lexicon, and in case the word is not in the lexicon, guess the most frequent letter in the lexicon that we did not guess so far.

You can (and probably you should) delegate well-defined parts to other functions. However, you are not allowed to make use of any additional libraries (including Counter from the collections library).

A sample lexicon is provided as lexicon.txt. This lexicon is also used for testing, please do not modify.

Grading

You are provided with pytest tests in test_a0.py that will run every time your code is pushed to GitHub. You can see their results on GitHub and observe what is failing. You can also run these tests locally through (IDE) terminal by calling pytest. Tests can also be ran individually by calling pytest <test_file_name>::<test_name>

Wrapping up

Do not forget to