Racket代写 | # Project 0: Tic-tac-toe in Racket


In this project, you will implement several racket functions to
implement a game of tic-tac-toe in Racket. All of your code will be
written in p0.rkt, please modify only that code. We encourage you to
read the GUI’s implementation in gui.rkt if you are interested—it
uses functions from your e0.rkt.

You will implement the following five (or six) functions:

– (board? lst) — checks whether a list l is a valid board
– (next-move board) — checks which player moves next
– (valid-move? board row col player) — checks whether a move is valid
– (make-move board row col player) — updates a board
– (winner? board) — checks whether a board has a winner
– (choose-next-move board) — EXCELLENT ONLY — implements an AI

Grading is as follows:

– To achieve a score of “minimally satisfactory,” you must pass all of
the public tests.
– To achieve a score of “satisfactory,” you must pass all of the
(non-bonus) public and hidden tests.
– To achieve a score of “excellent,” you must additionally pass all of
the bonus tests.

For a minimally-satisfactory score, you must consider boards of only
3*3. To get a satisfactory (and excellent) score, you must consider
boards of arbitrary N*N size.

## 0. Pre-requirement

This project assumes the following:

* Basic functions on lists: car, cdr, cons, append
* Control constructs: if, cond
* Logic operation: or, and
* Recursion

Our solution uses roughly the following functions / forms:
{car, cdr, and, or, equal?, null?, if, cons}

Some parts within this handout are collapsed, please click to expand them

## 1. Intro
| O| O |X |