Please turn in a PDF through Gradescope, as well as submitting code separately in Gradescope. Make sure that you mark the start/end of each question in Gradescope. Assignments will be graded based on what you mark as the start/end of each question. Please typeset your answers (LaTex/Word/OpenOffice/etc.)
For this question you will be implementing an agent that plays a generalized tic-tac-toe. For those not familiar, the environment is an n×n grid, the rules are that you may place a piece on any unoccupied square, and the goal is to get k of your pieces in a row.
You are to first implement an optimal, deterministic strategy agent using α-β search. Note that this is a communicating agent: Your actuator
is to write your move to a file (xmoves.txt for player x, omoves.txt for player o), with the move format player - x or o - followed by a number 1, 2, 3, ... for the row, letter a, b, c, ... for the column, and newline. e.g., means to place an x in the upper left corner.) Your sensor
is to read the opponent's move from their file.
There is a bit of systems issues
in the programming - you need to wait for the opponent's move using some for of blocking file read or other means of waiting until the opponent has made their move. How you do this will vary depending on your programming environment, but this will enable communicating players written in different programming languages.
You must follow the rules (e.g., you can't place a piece outside the board or on an occupied square.)
Your code should be called from the command line as ttt n k [xo] - if x, you go first, if o you go second. When complete (either one player wins, or a draw where the board is full with no winner) you should terminate with writing , , or to stdout.
Please report on the following. Report on the requested outcome and anything else you find interesting about the test.
Implement a strategy that you think may either be able to beat your strategy from Part 1, or that may run much faster than your Part 1 strategy on large n. Report on:
The player that goes first or second may have an advantage in this game. Imagine we did this instead as a simultaneous game, where both players try their move at the same time. If the players choose the same square, the move is void and they try again. Note: You do NOT have to implement this.
pure strategygame? Why or why not?
Problem to be deferred to a future assignment