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

This commit is contained in:
Dave Gauer 2021-03-05 11:01:16 -05:00
commit 0fea5bc00c
7 changed files with 10 additions and 10 deletions

1
.gitattributes vendored
View file

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

View file

@ -163,4 +163,3 @@ Planned exercises:
The initial topics for these exercises were unabashedly cribbed from
[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.

View file

@ -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;
}
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;
zig_args.append(builder.pathFromRoot(zig_file)) catch unreachable;

View file

@ -66,3 +66,6 @@ fn visitElephants(first_elephant: *Elephant) void {
// name or alias in a comment below this one and make a
// pull request on GitHub for a piece of eternal Ziglings
// 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

View file

@ -32,4 +32,3 @@ $ zig build -Dhealed [step]
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
alone, he'll leave you alone.

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# "I will be a shieldmaiden no longer,
# nor vie with the great Riders, nor
@ -14,7 +14,7 @@
#
# 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.
# Create healed/ directory here if it doesn't already exist.

View file

@ -1,12 +1,12 @@
#!/bin/bash
#!/bin/sh
#
# "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
# 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)
b=../exercises/$f.zig
a=../answers/$f.zig