Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GCJ bash aliases
function sakura {
cygstart /d/Program\ Files/sakura/sakura.exe `cygpath -m $@`
}
# 問題とサンプルデータを生成し、開く。
# usage: go A
function go() {
problem=$1
source=$problem.rb
data=$problem-sample.in
if [ ! -e $source ]; then
cp tmpl.rb $source
fi
if [ ! -e $data ]; then
touch $data
fi
sakura $source
sakura $data
}
# デバッグ実行
# usage: debug A <input_data_file>
function debug() {
problem=$1
in=$2
source=$problem.rb
ruby -d $source < $in
}
# サンプルデータで動作テスト
# usage: sample A
function sample() {
problem=$1
source=$problem.rb
in=$problem-sample.in
out=$problem-sample.out
ruby $source < $in
}
# Smallを実行
# usage: small A 0
function small() {
problem=$1
attempt=$2
source=$problem.rb
in=$problem-small-attempt$attempt.in
out=$problem-small-attempt$attempt.out
ruby $source < $in > $out
sakura $out
}
# Largeを実行
# usage: large A
function large() {
problem=$1
source=$problem.rb
in=$problem-large.in
out=$problem-large.out
ruby $source < $in > $out
sakura $out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.