restructured, flips working, benchmarking flips, got some basic terminal rendering
This commit is contained in:
parent
10de749e1d
commit
d7d8732904
17 changed files with 331 additions and 822 deletions
24
benches/reversals.rs
Normal file
24
benches/reversals.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
use std::hint::black_box;
|
||||
|
||||
use criterion::{Criterion, criterion_group, criterion_main};
|
||||
use othello::{
|
||||
board::{Board, squares::*},
|
||||
game::Game,
|
||||
};
|
||||
|
||||
const PLAYS: [Board; 15] = [F5, F4, E3, F3, G4, G5, H4, H5, E6, D3, C4, C5, D6, C6, B5];
|
||||
|
||||
fn bench_available_all_positions_sequential(c: &mut Criterion) {
|
||||
c.bench_function("play_four_move_opening", |b| {
|
||||
b.iter(|| {
|
||||
let mut game = Game::default();
|
||||
for play in PLAYS {
|
||||
black_box(game.play(play));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, bench_available_all_positions_sequential,);
|
||||
|
||||
criterion_main!(benches);
|
||||
Loading…
Add table
Add a link
Reference in a new issue