Skip to content

Commit

Permalink
真ん中に突っ込むのなおせたんじゃないか・・・・・?
Browse files Browse the repository at this point in the history
  • Loading branch information
iwiwi committed Jul 20, 2020
1 parent 68eaccb commit 818c4ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions AI
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# 例:
# AI_NAME=app
# AI_NAME=chokudAI
# AI_NAME=app_totsugeki
AI_NAME=wata
AI_NAME=app_totsugeki
# AI_NAME=wata

# AI に追加で渡したいフラグを入れてください
# 例:
Expand Down
7 changes: 7 additions & 0 deletions src/bin/app_totsugeki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ fn run() {
println!("!!!TOTSUGEKI!!!!");
let mut router = app::routing::Router::new();

//dbg!(&app::routing::PosVel::new(-17, 7, 2, 4).is_in_valid_area());

// dbg!(&router.get_next_move(-48, -23, 0, 0, 48, 23)); // cowday最初のターン
// dbg!(&router.get_next_move(-19, 3, 3, 6, 9, 17)); // cowday死ぬ直前 - 1
// return;
// dbg!(&router.get_next_move(-17, 7, 2, 4, 4, 17)); // cowday死ぬ直前

/*
dbg!(&router.get_next_move(1, 35, 0, 0, -100, -100));
return;
Expand Down
14 changes: 4 additions & 10 deletions src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,14 @@ impl PosVel {
let mut pv = self.clone();
for _ in 0..n_simulated_iters {
pv = pv.apply_gravity().accelerate_and_move(dvx, dvy);
if !pv.is_in_invalid_area_sub() {
ok |= false;
break;
}
ok &= pv.is_in_invalid_area_sub();
}
any_ok |= ok;
if any_ok {
break;
}
}
if any_ok {
break;
}
}
if !any_ok {
return false;
}

true
}
Expand Down

0 comments on commit 818c4ce

Please sign in to comment.