File size: 1,156 Bytes
a89cc9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43bb465
 
 
 
a89cc9c
 
22ae33a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a89cc9c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
tags:
  - tictactoe
  - game
  - api
  - flask
license: apache-2.0
widget:
  - text: "Make a move at position 0"
  - text: "Get the board status"
model-index:
  - name: TicTacToe AI Model
    results:
      - task:
          type: "reinforcement-learning"
        metrics:
          - name: Accuracy
            type: "accuracy"
            value: 0.95  # Example accuracy value; replace with the actual result after evaluating your model
---

# Tic-Tac-Toe API

This is a simple API for playing Tic-Tac-Toe using Python and Flask.

## Endpoints

- **POST /make_move**: Makes a move on the board.
  - **Request Body**: 
    ```json
    {
      "move": <int>,  # 0 to 8, representing a cell on the 3x3 board
      "player": "<str>"  # 'X' or 'O'
    }
    ```
  - **Response**: 
    ```json
    {
      "board": [[<row1>], [<row2>], [<row3>]],
      "message": "Move successful."
    }
    ```

- **GET /get_board**: Returns the current state of the board.
  - **Response**:
    ```json
    {
      "board": [[<row1>], [<row2>], [<row3>]]
    }
    ```

## Running the Project

1. **Install dependencies**:
   ```bash
   pip install -r requirements.txt