Assignment 0
Deadline: Nov, 4 2022 14:00 CET
Grading
You are provided with tests that will run every time your code is pushed. You can see their results and observe what is failing and how. You can also run these tests using your IDE terminal by calling pytest <test_file_name>
. Tests can also be ran individually by calling pytest <test_file_name>::<test_name>
Exercises
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. It will not count toward your overall grade, but you are encouraged to complete it before next Friday.
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.
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.
Wrapping up
Do not forget to
- indicate your name(s) in the file header
- commit all your changes
- push it to your GitHub repository