Prolog (SWI-Prolog) image for INGInious
341
Example of run:
#!/bin/bash
echo "#!/usr/bin/swipl -f -q" > student/test.pl
echo ":- initialization main." >> student/test.pl
getinput 1 >> student/test.pl
chmod +x student/test.pl
output=$(run_student ./student/test.pl 2> errors)
if [ "$( cat errors )" != "" ]; then
feedback-result failed
feedback-msg -em "There are errors in your code:\n\n"
echo "$(cat errors)" | feedback-msg -ae
exit
fi
if [ "$output" == "Hello, World!" ]; then
feedback-result success
feedback-msg -em "Your code is right! Output:\n\n"
else
feedback-result failed
feedback-msg -em "Your code is false. Output:\n\n"
fi
echo $output | feedback-msg -ae
Content type
Image
Digest
Size
445.5 MB
Last updated
over 9 years ago
docker pull bogem/inginious-c-prolog