2021-03-02 04:41:34 +00:00
|
|
|
#!/bin/sh
|
2021-02-14 23:36:09 +00:00
|
|
|
#
|
|
|
|
# "It isn't fair, my precious, is it,
|
|
|
|
# to ask us what it's got in it's
|
|
|
|
# nassty little pocketsess?"
|
2021-03-02 04:41:34 +00:00
|
|
|
# Gollum, The Hobbit, or There and Back Again
|
2021-02-14 23:36:09 +00:00
|
|
|
#
|
|
|
|
|
2021-03-02 04:41:34 +00:00
|
|
|
cd $(dirname $(realpath $0))
|
2021-02-14 23:36:09 +00:00
|
|
|
f=$(basename ../exercises/$1*.zig .zig 2> /dev/null)
|
|
|
|
b=../exercises/$f.zig
|
|
|
|
a=../answers/$f.zig
|
2021-02-15 01:26:57 +00:00
|
|
|
p=patches/$f.patch
|
2021-02-14 23:36:09 +00:00
|
|
|
|
|
|
|
printf "\tf: '$f'\n\tb: '$b'\n\ta: '$a'\n"
|
|
|
|
|
|
|
|
if [[ ! -f $b ]]; then echo "We hates it!"; exit 1; fi
|
|
|
|
if [[ ! -a $a ]]; then echo "Where is it? Where is the answer, precious?"; exit; fi
|
|
|
|
|
|
|
|
echo Hisssss!
|
|
|
|
|
|
|
|
diff $b $a > $p
|
|
|
|
|
|
|
|
cat $p
|