Skip to content

Commit 818c4ce

Browse files
committed
真ん中に突っ込むのなおせたんじゃないか・・・・・?
1 parent 68eaccb commit 818c4ce

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

AI

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# 例:
33
# AI_NAME=app
44
# AI_NAME=chokudAI
5-
# AI_NAME=app_totsugeki
6-
AI_NAME=wata
5+
AI_NAME=app_totsugeki
6+
# AI_NAME=wata
77

88
# AI に追加で渡したいフラグを入れてください
99
# 例:

src/bin/app_totsugeki.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ fn run() {
2121
println!("!!!TOTSUGEKI!!!!");
2222
let mut router = app::routing::Router::new();
2323

24+
//dbg!(&app::routing::PosVel::new(-17, 7, 2, 4).is_in_valid_area());
25+
26+
// dbg!(&router.get_next_move(-48, -23, 0, 0, 48, 23)); // cowday最初のターン
27+
// dbg!(&router.get_next_move(-19, 3, 3, 6, 9, 17)); // cowday死ぬ直前 - 1
28+
// return;
29+
// dbg!(&router.get_next_move(-17, 7, 2, 4, 4, 17)); // cowday死ぬ直前
30+
2431
/*
2532
dbg!(&router.get_next_move(1, 35, 0, 0, -100, -100));
2633
return;

src/routing.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,14 @@ impl PosVel {
150150
let mut pv = self.clone();
151151
for _ in 0..n_simulated_iters {
152152
pv = pv.apply_gravity().accelerate_and_move(dvx, dvy);
153-
if !pv.is_in_invalid_area_sub() {
154-
ok |= false;
155-
break;
156-
}
153+
ok &= pv.is_in_invalid_area_sub();
157154
}
158155
any_ok |= ok;
159-
if any_ok {
160-
break;
161-
}
162-
}
163-
if any_ok {
164-
break;
165156
}
166157
}
158+
if !any_ok {
159+
return false;
160+
}
167161

168162
true
169163
}

0 commit comments

Comments
 (0)