You must create some functions for a tic-tac-toe checker.
Create the following functions:
- `tic_tac_toe` which receives:
- a table of vectors (Vec<Vec<&str>>).
- It should return a String `player O won` or `player X won` or `Tie`.
- `diagonals` which will receive:
- a player and a table.
- It should return a boolean, this must return `true` if one of the diagonals are completed by the player.
- `horizontal` which will receive:
- a player and a table.
- It should return a boolean, this must return `true` if one of the horizontal lines are completed by the player.
- `vertical` which will receive:
- a player and a table.
- It should return a boolean, this must return `true` if one of the vertical lines are completed by the player.
### Notions
Create a function named `tic_tac_toe`, which receives a tic-tac-toe table. It should return the appropriate string: `"player O won"`, `"player X won"` or `"Tie"`.
- [references and borrowing](https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html)
Also create the following functions, which each accept a player and a table. These functions should return `true` if the player has completed one of the diagonals, rows or columns:
Here is a program to test your `tic_tac_toe`. You'll need to test the other functions yourself. But they'll probably be useful for implementing your `tic_tac_toe` checker.
```rust
```rust
use tic_tac_toe::*;
use tic_tac_toe::*;
@ -86,3 +71,7 @@ $ cargo run
"player X won"
"player X won"
$
$
```
```
### Notions
- [references and borrowing](https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html)