Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
fix: gcc & python 체크
Browse files Browse the repository at this point in the history
  • Loading branch information
kiryanchi committed Mar 8, 2024
1 parent ae9275e commit 4e4020a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion grade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,28 @@ IS_PASS=true

if [ "$1" == "c" ]; then
echo "C 채점을 시작합니다."
if ! (which gcc >/dev/null); then
echo "GCC가 없습니다. 채점을 종료합니다."
exit 1
fi
else
echo "Python 채점을 시작합니다."
if ! (which python3 >/dev/null); then
if ! (which python >/dev/null); then
echo "설치된 python이 없습니다. 채점을 종료합니다."
exit 1
fi
fi
fi

function python_result() {
# $1: index of problem, $2: input file, $3: output file

result=`cat $2 | python ./python/$1.py | tr -d '\r' | tr -d '\t'`
if ! (which python3 >/dev/null); then
result=`cat $2 | python ./python/$1.py | tr -d '\r' | tr -d '\t'`
else
result=`cat $2 | python3 ./python/$1.py | tr -d '\r' | tr -d '\t'`
fi
output=`cat $3 | tr -d '\r' | tr -d '\t'`


Expand Down

0 comments on commit 4e4020a

Please sign in to comment.