Merge branch 'main' of github.com:ratfactor/ziglings into main

pull/2/head
Dave Gauer 4 years ago
commit 0fea5bc00c

1
.gitattributes vendored

@ -14,4 +14,3 @@
# Text files to always have LF (unix) line endings on checkout. # Text files to always have LF (unix) line endings on checkout.
*.sh text eol=lf *.sh text eol=lf
*.zig text eol=lf *.zig text eol=lf

@ -163,4 +163,3 @@ Planned exercises:
The initial topics for these exercises were unabashedly cribbed from The initial topics for these exercises were unabashedly cribbed from
[ziglearn.org](https://ziglearn.org/). I've since moved things around [ziglearn.org](https://ziglearn.org/). I've since moved things around
in an order that I think best lets each topic build upon each other. in an order that I think best lets each topic build upon each other.

@ -348,7 +348,7 @@ pub fn build(b: *Builder) void {
\\ _ _ _ \\ _ _ _
\\ ___(_) __ _| (_)_ __ __ _ ___ \\ ___(_) __ _| (_)_ __ __ _ ___
\\ |_ | |/ _' | | | '_ \ / _' / __| \\ |_ | |/ _' | | | '_ \ / _' / __|
\\ / /| | (_| | | | | | | (_| \__ \ \\ / /| | (_| | | | | | | (_| \__ \
\\ /___|_|\__, |_|_|_| |_|\__, |___/ \\ /___|_|\__, |_|_|_| |_|\__, |___/
\\ |___/ |___/ \\ |___/ |___/
\\ \\
@ -525,7 +525,7 @@ const ZiglingStep = struct {
zig_args.append(@tagName(builder.color)) catch unreachable; zig_args.append(@tagName(builder.color)) catch unreachable;
} }
const zig_file = std.fs.path.join(builder.allocator, &[_][]const u8{ const zig_file = std.fs.path.join(builder.allocator, &[_][]const u8{
if (self.use_healed) "patches/healed" else "exercises", self.exercise.main_file }) catch unreachable; if (self.use_healed) "patches/healed" else "exercises", self.exercise.main_file }) catch unreachable;
zig_args.append(builder.pathFromRoot(zig_file)) catch unreachable; zig_args.append(builder.pathFromRoot(zig_file)) catch unreachable;

@ -66,3 +66,6 @@ fn visitElephants(first_elephant: *Elephant) void {
// name or alias in a comment below this one and make a // name or alias in a comment below this one and make a
// pull request on GitHub for a piece of eternal Ziglings // pull request on GitHub for a piece of eternal Ziglings
// glory. The first five (5) PRs will be accepted! // glory. The first five (5) PRs will be accepted!
//
// 1) drforester - I found one in the Zig source:
// https://github.com/ziglang/zig/blob/041212a41cfaf029dc3eb9740467b721c76f406c/src/Compilation.zig#L2495

@ -32,4 +32,3 @@ $ zig build -Dhealed [step]
Another Bash shell script named `gollum.sh` may also be found. He snatches the Another Bash shell script named `gollum.sh` may also be found. He snatches the
original answers and stows them in his secret answers stash. If you leave him original answers and stows them in his secret answers stash. If you leave him
alone, he'll leave you alone. alone, he'll leave you alone.

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# #
# "I will be a shieldmaiden no longer, # "I will be a shieldmaiden no longer,
# nor vie with the great Riders, nor # nor vie with the great Riders, nor
@ -14,7 +14,7 @@
# #
# We run from the patches dir. Go there now if not already. # We run from the patches dir. Go there now if not already.
cd $(dirname $(which $0)) cd $(dirname $(realpath $0))
pwd # Show it upon the screen so all shall be made apparent. pwd # Show it upon the screen so all shall be made apparent.
# Create healed/ directory here if it doesn't already exist. # Create healed/ directory here if it doesn't already exist.

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/sh
# #
# "It isn't fair, my precious, is it, # "It isn't fair, my precious, is it,
# to ask us what it's got in it's # to ask us what it's got in it's
# nassty little pocketsess?" # nassty little pocketsess?"
# Gollum, The Hobbit, or There and Back Again # Gollum, The Hobbit, or There and Back Again
# #
cd $(dirname $(which $0)) cd $(dirname $(realpath $0))
f=$(basename ../exercises/$1*.zig .zig 2> /dev/null) f=$(basename ../exercises/$1*.zig .zig 2> /dev/null)
b=../exercises/$f.zig b=../exercises/$f.zig
a=../answers/$f.zig a=../answers/$f.zig

Loading…
Cancel
Save