parent
654437c0bc
commit
03a09639c6
@ -0,0 +1,4 @@
|
|||||||
|
19c19
|
||||||
|
< fn main() void {
|
||||||
|
---
|
||||||
|
> pub fn main() void {
|
@ -0,0 +1,4 @@
|
|||||||
|
14c14
|
||||||
|
< ??? = @import("std");
|
||||||
|
---
|
||||||
|
> const std = @import("std");
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# "I will be a shieldmaiden no longer,
|
||||||
|
# nor vie with the great Riders, nor
|
||||||
|
# take joy only in the songs of slaying.
|
||||||
|
# I will be a healer, and love all things
|
||||||
|
# that grow and are not barren."
|
||||||
|
# Éowyn, The Return of the King
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# This script shall heal the little broken programs
|
||||||
|
# using the patches in this directory and convey them
|
||||||
|
# to convalesce in the healed directory.
|
||||||
|
#
|
||||||
|
|
||||||
|
# We run from the patches dir. Go there now if not already.
|
||||||
|
cd $(dirname $(which $0))
|
||||||
|
pwd # Show it upon the screen so all shall be made apparent.
|
||||||
|
|
||||||
|
# Create healed/ directory here if it doesn't already exist.
|
||||||
|
mkdir -p healed
|
||||||
|
|
||||||
|
# Cycle through all the little broken Zig applications.
|
||||||
|
for broken in ../exercises/*.zig
|
||||||
|
do
|
||||||
|
# Remove the dir and extension, rendering the True Name.
|
||||||
|
true_name=$(basename $broken .zig)
|
||||||
|
|
||||||
|
if [[ -f $true_name.patch ]]
|
||||||
|
then
|
||||||
|
# Apply the bandages to the wounds, grow new limbs, let
|
||||||
|
# new life spring into the broken bodies of the fallen.
|
||||||
|
echo Healing $true_name...
|
||||||
|
patch --output=healed/$true_name.zig $broken $true_name.patch
|
||||||
|
else
|
||||||
|
echo Cannot heal $true_name. Making empty patch.
|
||||||
|
echo > $true_name.patch
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Return to the home of our ancestors.
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Test the healed exercises. May the compiler have mercy upon us.
|
||||||
|
zig build -Dhealed
|
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# "It isn't fair, my precious, is it,
|
||||||
|
# to ask us what it's got in it's
|
||||||
|
# nassty little pocketsess?"
|
||||||
|
# Gollum, The Hobbit, or There and Back Again
|
||||||
|
#
|
||||||
|
|
||||||
|
cd $(dirname $(which $0))
|
||||||
|
f=$(basename ../exercises/$1*.zig .zig 2> /dev/null)
|
||||||
|
b=../exercises/$f.zig
|
||||||
|
a=../answers/$f.zig
|
||||||
|
p=$f.patch
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in New Issue