This repository has four folders, each corresponding to one area of AI (learning, optimization, reasoning and search). Each of those folders, holds one or two projects, in which methods of the related field of AI are used to solve a problem.
The assignments for the projects is taken from the course https://cs50.harvard.edu/ai/2020/. Each of the projects had an uncompleted code base. The task was to those, to make the projects run.
- Nim
- Crossword
- Knights and Knaves
- Degrees
- TicTacToe
Install requirements.txt with:
pip3 install -r requirements.txt
Make sure you installed the dependencies
How to run:
- Set x in play.py (
ai = train(x)) to the amount of games the AI should play befor facing you - Run the game with
python play.pyand follow the instruction in the terminal
Functions which implementation needed to be completed:
- get_q_value
- update_q_value
- best_future_reward
- choose_action
How to run:
Run python generate.py data/structure0.txt data/words0.txt name_of_img.png
- Change the crossword layout by changing
data/structure0.txttodata/structure1.txtordata/structure2.txt - Change the set of words by changing
data/words0.txttodata/words1.txtordata/words2.txt - The last argument
name_of_img.pngsets the name of the saved image, leave it blank to not save the image
Functions which implementation needed to be completed:
- enforce_node_consitency
- revise
- ac3
- assignment_complete
- consistent
- order_domain_values
- select_unassinged_variable
- backtrack
How to run:
Run python puzzle.py
Functions which implementation needed to be completed:
No functions needed to be implemented for this project, only the sentences for each puzzle and the general information over the rules of the game
How to run:
- Run
python degrees.pyorpython degrees_optimized.py(if you dont want to wait that long) - Copy and past each time a different name from large/people.csv, when the terminal asks for a name
Functions which implementation needed to be completed:
- shortest_path
How to run:
- Run
python runner.py - Follow the instructions of the window which will open
Functions which implementation needed to be completed:
- player
- actions
- result
- winner
- terminal
- utility
- minimax