30 lines
425 B
Rust
30 lines
425 B
Rust
![]() |
use std::io::Empty;
|
||
|
|
||
|
pub enum Cell {
|
||
|
Empty,
|
||
|
X,
|
||
|
O,
|
||
|
}
|
||
|
|
||
|
pub struct Board {
|
||
|
cells: Vec<Cell>,
|
||
|
next: Cell,
|
||
|
}
|
||
|
|
||
|
impl Board {
|
||
|
pub fn new() -> Board {
|
||
|
return Board {
|
||
|
cells: Vec::new(),
|
||
|
next: Cell::X,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
pub fn put(&self, x: usize, y: usize, _: Cell) -> bool {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
pub fn winner(self) -> Cell {
|
||
|
return Cell::Empty;
|
||
|
}
|
||
|
}
|