Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doubly-linked-list: Fix inaccurate instructions #1740

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tmp
exercises/*/*/Cargo.lock
exercises/*/*/clippy.log
.vscode
.prob-spec
12 changes: 12 additions & 0 deletions bin/symlink_problem_specifications.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail

cd "$(git rev-parse --show-toplevel)"

for exercise in exercises/practice/*; do
name="$(basename "$exercise")"
if [ -d "problem-specifications/exercises/$name" ]; then
[ -e "$exercise/.prob-spec" ] && rm "$exercise/.prob-spec"
ln -s "../../../problem-specifications/exercises/$name" "$exercise/.prob-spec"
fi
done
5 changes: 5 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ Find some tips about writing tera templates [in the next section](#tera-template
The full documentation for tera templates is [here][tera-docs].
Following are some approaches that have worked for our specific needs.

You will likely want to look at the exercise's `canonical-data.json`
to see what structure your input data has.
You can use `bin/symlink_problem_specifications.sh` to have this data
symlinked into the actual exercise directory. Handy!

The name of the input property is different for each exercise.
The default template will be something like this:

Expand Down
6 changes: 1 addition & 5 deletions exercises/practice/doubly-linked-list/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
Write a doubly linked list using unsafe Rust, including an iterator over the list
and a cursor for efficient mutation.

The doubly linked list is a fundamental data structure in computer science,
often used in the implementation of other data structures. They're
pervasive in functional programming languages, such as Clojure, Erlang,
or Haskell, but far less common in imperative languages such as Ruby or
Python.
The doubly linked list is a fundamental data structure in computer science.

Each node in a doubly linked list contains data and pointers to the next
and previous node, if they exist.
Expand Down