Skip to content

Commit f20e96e

Browse files
authored
Read /AI on release (#67)
1 parent 16f15d3 commit f20e96e

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

AI

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AI の名前をちゃんと大文字小文字を間違えずに入れる
2+
# 例:
3+
# AI_NAME=app
4+
# AI_NAME=chokudAI
5+
AI_NAME=chokudAI
6+
7+
# AI に追加で渡したいフラグを入れてください
8+
# 例:
9+
# AI_FALGS=() # 空のときの例
10+
# AI_FALGS=(--attacker=chokudai --defender=wata) # 複数フラグ
11+
AI_FLAGS=()

script/build-submission.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ popd
1818

1919
cp -a src build/submission/src
2020
cp -a data build/submission/data
21+
cp -a AI build/submission/AI
2122
cp -a Cargo.toml Cargo.lock build/submission/
2223
cp -a submission/* build/submission/
2324

submission/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -eux
44

5-
cargo build --release --offline --bin=chokudAI
6-
cp ./target/release/chokudAI app
5+
source ./AI
6+
7+
cargo build --release --offline --bin="${AI_NAME}"
8+
cp "./target/release/${AI_NAME}" app
79
rm -rf ./target

submission/run.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ export ICFPC_API_HOST=$1
66
export ICFPC_API_KEY=$2
77
export JUDGE_SERVER=1
88

9-
free -h
10-
for f in /sys/fs/cgroup/memory/*; do
11-
echo $f
12-
cat $f || echo 'failed to read'
13-
echo
14-
done
15-
cat /proc/cpuinfo
9+
source ./AI
1610

17-
./app ${EXTRA_FLASG:-} "$@" || \
11+
./app "${AI_FLAGS[@]}" ${EXTRA_FLAGS:-} "$@" || \
1812
echo "ERROR: exit_code=$?"

0 commit comments

Comments
 (0)