From 7fe5bfe9e5a7972916d4edc874165d498bcaacba Mon Sep 17 00:00:00 2001 From: Dimitri Belopopsky Date: Sun, 7 Nov 2021 16:25:18 +0100 Subject: [PATCH] Standardise code directory names (#920) * Rename c++ directories to cpp * Rename golang folders to go * Change paths to code in chapter files Co-authored-by: James Schloss --- contents/IFS/IFS.md | 4 +-- contents/IFS/code/{c++ => cpp}/IFS.cpp | 0 .../approximate_counting.md | 2 +- .../{c++ => cpp}/approximate_counting.cpp | 0 contents/barnsley/barnsley.md | 2 +- .../barnsley/code/{c++ => cpp}/barnsley.cpp | 0 .../code/{c++ => cpp}/gauss_easter.cpp | 0 contents/computus/computus.md | 2 +- .../cooley_tukey/code/{c++ => cpp}/fft.cpp | 0 contents/cooley_tukey/cooley_tukey.md | 6 ++-- .../code/{c++ => cpp}/euclidean.cpp | 0 .../euclidean_algorithm.md | 6 ++-- .../code/{c++ => cpp}/euler.cpp | 0 .../code/{golang => go}/euler.go | 0 .../forward_euler_method.md | 4 +-- .../{c++ => cpp}/gaussian_elimination.cpp | 0 .../gaussian_elimination.md | 12 ++++---- .../code/{c++ => cpp}/graham_scan.cpp | 0 .../graham_scan/code/{golang => go}/graham.go | 0 contents/graham_scan/graham_scan.md | 12 ++++---- .../code/{c++ => cpp}/huffman.cpp | 0 .../code/{golang => go}/huffman.go | 0 contents/huffman_encoding/huffman_encoding.md | 4 +-- .../code/{c++ => cpp}/jarvis_march.cpp | 0 .../code/{golang => go}/jarvis.go | 0 contents/jarvis_march/jarvis_march.md | 4 +-- .../code/{c++ => cpp}/monte_carlo.cpp | 0 .../monte_carlo_integration.md | 4 +-- contents/quantum_systems/quantum_systems.md | 2 +- .../code/{c++ => cpp}/split_op.cpp | 0 .../split-operator_method.md | 8 +++--- .../code/{c++ => cpp}/stable_marriage.cpp | 0 .../stable_marriage_problem.md | 2 +- .../code/{c++ => cpp}/thomas.cpp | 0 .../code/{golang => go}/thomas.go | 0 contents/thomas_algorithm/thomas_algorithm.md | 4 +-- .../code/{c++ => cpp}/tree_example.cpp | 0 .../code/{golang => go}/treetraversal.go | 0 contents/tree_traversal/tree_traversal.md | 28 +++++++++---------- .../code/{c++ => cpp}/verlet.cpp | 0 .../code/{golang => go}/verlet.go | 0 .../verlet_integration/verlet_integration.md | 16 +++++------ 42 files changed, 61 insertions(+), 61 deletions(-) rename contents/IFS/code/{c++ => cpp}/IFS.cpp (100%) rename contents/approximate_counting/code/{c++ => cpp}/approximate_counting.cpp (100%) rename contents/barnsley/code/{c++ => cpp}/barnsley.cpp (100%) rename contents/computus/code/{c++ => cpp}/gauss_easter.cpp (100%) rename contents/cooley_tukey/code/{c++ => cpp}/fft.cpp (100%) rename contents/euclidean_algorithm/code/{c++ => cpp}/euclidean.cpp (100%) rename contents/forward_euler_method/code/{c++ => cpp}/euler.cpp (100%) rename contents/forward_euler_method/code/{golang => go}/euler.go (100%) rename contents/gaussian_elimination/code/{c++ => cpp}/gaussian_elimination.cpp (100%) rename contents/graham_scan/code/{c++ => cpp}/graham_scan.cpp (100%) rename contents/graham_scan/code/{golang => go}/graham.go (100%) rename contents/huffman_encoding/code/{c++ => cpp}/huffman.cpp (100%) rename contents/huffman_encoding/code/{golang => go}/huffman.go (100%) rename contents/jarvis_march/code/{c++ => cpp}/jarvis_march.cpp (100%) rename contents/jarvis_march/code/{golang => go}/jarvis.go (100%) rename contents/monte_carlo_integration/code/{c++ => cpp}/monte_carlo.cpp (100%) rename contents/split-operator_method/code/{c++ => cpp}/split_op.cpp (100%) rename contents/stable_marriage_problem/code/{c++ => cpp}/stable_marriage.cpp (100%) rename contents/thomas_algorithm/code/{c++ => cpp}/thomas.cpp (100%) rename contents/thomas_algorithm/code/{golang => go}/thomas.go (100%) rename contents/tree_traversal/code/{c++ => cpp}/tree_example.cpp (100%) rename contents/tree_traversal/code/{golang => go}/treetraversal.go (100%) rename contents/verlet_integration/code/{c++ => cpp}/verlet.cpp (100%) rename contents/verlet_integration/code/{golang => go}/verlet.go (100%) diff --git a/contents/IFS/IFS.md b/contents/IFS/IFS.md index 2ed1fe484..9431e4631 100644 --- a/contents/IFS/IFS.md +++ b/contents/IFS/IFS.md @@ -135,7 +135,7 @@ Here, instead of tracking children of children, we track a single individual tha {% sample lang="hs" %} [import:7-13, lang:"haskell"](code/haskell/IFS.hs) {% sample lang="cpp" %} -[import:39-52, lang:"cpp"](code/c++/IFS.cpp) +[import:39-52, lang:"cpp"](code/cpp/IFS.cpp) {% sample lang="py" %} [import:5-12, lang:"python"](code/python/IFS.py) {% sample lang="c" %} @@ -221,7 +221,7 @@ In addition, we have written the chaos game code to take in a set of points so t {% sample lang="hs" %} [import, lang:"haskell"](code/haskell/IFS.hs) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/IFS.cpp) +[import, lang:"cpp"](code/cpp/IFS.cpp) {% sample lang="py" %} [import, lang:"python"](code/python/IFS.py) {% sample lang="c" %} diff --git a/contents/IFS/code/c++/IFS.cpp b/contents/IFS/code/cpp/IFS.cpp similarity index 100% rename from contents/IFS/code/c++/IFS.cpp rename to contents/IFS/code/cpp/IFS.cpp diff --git a/contents/approximate_counting/approximate_counting.md b/contents/approximate_counting/approximate_counting.md index 654721844..ae4a765d6 100644 --- a/contents/approximate_counting/approximate_counting.md +++ b/contents/approximate_counting/approximate_counting.md @@ -363,7 +363,7 @@ As we do not have any objects to count, we will instead simulate the counting wi {% sample lang="c" %} [import, lang:"c"](code/c/approximate_counting.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/approximate_counting.cpp) +[import, lang:"cpp"](code/cpp/approximate_counting.cpp) {% sample lang="python" %} [import, lang:"python"](code/python/approximate_counting.py) {% endmethod %} diff --git a/contents/approximate_counting/code/c++/approximate_counting.cpp b/contents/approximate_counting/code/cpp/approximate_counting.cpp similarity index 100% rename from contents/approximate_counting/code/c++/approximate_counting.cpp rename to contents/approximate_counting/code/cpp/approximate_counting.cpp diff --git a/contents/barnsley/barnsley.md b/contents/barnsley/barnsley.md index f696b9ffb..c879d7bbd 100644 --- a/contents/barnsley/barnsley.md +++ b/contents/barnsley/barnsley.md @@ -128,7 +128,7 @@ The biggest differences between the two code implementations is that the Barnsle {% sample lang="rs" %} [import, lang:"rust"](code/rust/src/main.rs) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/barnsley.cpp) +[import, lang:"cpp"](code/cpp/barnsley.cpp) {% sample lang="c" %} [import, lang:"c"](code/c/barnsley.c) {% sample lang="java" %} diff --git a/contents/barnsley/code/c++/barnsley.cpp b/contents/barnsley/code/cpp/barnsley.cpp similarity index 100% rename from contents/barnsley/code/c++/barnsley.cpp rename to contents/barnsley/code/cpp/barnsley.cpp diff --git a/contents/computus/code/c++/gauss_easter.cpp b/contents/computus/code/cpp/gauss_easter.cpp similarity index 100% rename from contents/computus/code/c++/gauss_easter.cpp rename to contents/computus/code/cpp/gauss_easter.cpp diff --git a/contents/computus/computus.md b/contents/computus/computus.md index 0b474c9a9..3a881cdb0 100644 --- a/contents/computus/computus.md +++ b/contents/computus/computus.md @@ -315,7 +315,7 @@ For now, we have the code outputting a tuple of $$d$$ and $$e$$, so users can us {% sample lang="c" %} [import, lang:"c"](code/c/gauss_easter.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/gauss_easter.cpp) +[import, lang:"cpp"](code/cpp/gauss_easter.cpp) {% sample lang="lisp" %} [import, lang:"lisp"](code/clisp/gauss-easter.lisp) {% sample lang="nim" %} diff --git a/contents/cooley_tukey/code/c++/fft.cpp b/contents/cooley_tukey/code/cpp/fft.cpp similarity index 100% rename from contents/cooley_tukey/code/c++/fft.cpp rename to contents/cooley_tukey/code/cpp/fft.cpp diff --git a/contents/cooley_tukey/cooley_tukey.md b/contents/cooley_tukey/cooley_tukey.md index 67309b5d2..b30052e40 100644 --- a/contents/cooley_tukey/cooley_tukey.md +++ b/contents/cooley_tukey/cooley_tukey.md @@ -76,7 +76,7 @@ For some reason, though, putting code to this transformation really helped me fi {% sample lang="clj" %} [import:15-30, lang:"clojure"](code/clojure/fft.clj) {% sample lang="cpp" %} -[import:23-33, lang:"cpp"](code/c++/fft.cpp) +[import:23-33, lang:"cpp"](code/cpp/fft.cpp) {% sample lang="hs" %} [import:7-13, lang:"haskell"](code/haskell/fft.hs) {% sample lang="py" %} @@ -129,7 +129,7 @@ In the end, the code looks like: {% sample lang="clj" %} [import:31-58, lang:"clojure"](code/clojure/fft.clj) {% sample lang="cpp" %} -[import:36-66, lang:"cpp"](code/c++/fft.cpp) +[import:36-66, lang:"cpp"](code/cpp/fft.cpp) {% sample lang="hs" %} [import:15-28, lang:"haskell"](code/haskell/fft.hs) {% sample lang="py" %} @@ -242,7 +242,7 @@ Note: I implemented this in Julia because the code seems more straightforward in {% sample lang="clj" %} [import, lang:"clojure"](code/clojure/fft.clj) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/fft.cpp) +[import, lang:"cpp"](code/cpp/fft.cpp) {% sample lang="hs" %} [import, lang:"haskell"](code/haskell/fft.hs) {% sample lang="py" %} diff --git a/contents/euclidean_algorithm/code/c++/euclidean.cpp b/contents/euclidean_algorithm/code/cpp/euclidean.cpp similarity index 100% rename from contents/euclidean_algorithm/code/c++/euclidean.cpp rename to contents/euclidean_algorithm/code/cpp/euclidean.cpp diff --git a/contents/euclidean_algorithm/euclidean_algorithm.md b/contents/euclidean_algorithm/euclidean_algorithm.md index f44c3acb7..1d6211a37 100644 --- a/contents/euclidean_algorithm/euclidean_algorithm.md +++ b/contents/euclidean_algorithm/euclidean_algorithm.md @@ -14,7 +14,7 @@ The algorithm is a simple way to find the *greatest common divisor* (GCD) of two {% sample lang="clj" %} [import:2-8, lang="clojure"](code/clojure/euclidean_example.clj) {% sample lang="cpp" %} -[import:18-31, lang="c_cpp"](code/c++/euclidean.cpp) +[import:18-31, lang="c_cpp"](code/cpp/euclidean.cpp) {% sample lang="java" %} [import:3-16, lang="java"](code/java/EuclideanAlgo.java) {% sample lang="kotlin" %} @@ -104,7 +104,7 @@ Modern implementations, though, often use the modulus operator (%) like so {% sample lang="clj" %} [import:9-13, lang="clojure"](code/clojure/euclidean_example.clj) {% sample lang="cpp" %} -[import:5-15, lang="c_cpp"](code/c++/euclidean.cpp) +[import:5-15, lang="c_cpp"](code/cpp/euclidean.cpp) {% sample lang="java" %} [import:18-26, lang="java"](code/java/EuclideanAlgo.java) {% sample lang="kotlin" %} @@ -207,7 +207,7 @@ Here's a video on the Euclidean algorithm: {% sample lang="clj" %} [import, lang="clojure"](code/clojure/euclidean_example.clj) {% sample lang="cpp" %} -[import, lang="c_cpp"](code/c++/euclidean.cpp) +[import, lang="c_cpp"](code/cpp/euclidean.cpp) {% sample lang="java" %} [import, lang="java"](code/java/EuclideanAlgo.java) {% sample lang="kotlin" %} diff --git a/contents/forward_euler_method/code/c++/euler.cpp b/contents/forward_euler_method/code/cpp/euler.cpp similarity index 100% rename from contents/forward_euler_method/code/c++/euler.cpp rename to contents/forward_euler_method/code/cpp/euler.cpp diff --git a/contents/forward_euler_method/code/golang/euler.go b/contents/forward_euler_method/code/go/euler.go similarity index 100% rename from contents/forward_euler_method/code/golang/euler.go rename to contents/forward_euler_method/code/go/euler.go diff --git a/contents/forward_euler_method/forward_euler_method.md b/contents/forward_euler_method/forward_euler_method.md index d4aa7375c..f97ff27a2 100644 --- a/contents/forward_euler_method/forward_euler_method.md +++ b/contents/forward_euler_method/forward_euler_method.md @@ -112,7 +112,7 @@ Note that in this case, the velocity is directly given by the ODE and the accele {% sample lang="c" %} [import, lang:"c"](code/c/euler.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/euler.cpp) +[import, lang:"cpp"](code/cpp/euler.cpp) {% sample lang="rs" %} [import, lang:"rust"](code/rust/euler.rs) {% sample lang="elm" %} @@ -135,7 +135,7 @@ Full code for the visualization follows: {% sample lang="f90" %} [import, lang:"fortran"](code/fortran/euler.f90) {% sample lang="go" %} -[import, lang:"go"](code/golang/euler.go) +[import, lang:"go"](code/go/euler.go) {% sample lang="v" %} [import, lang:"v"](code/v/euler.v) {% sample lang="asm-x64" %} diff --git a/contents/gaussian_elimination/code/c++/gaussian_elimination.cpp b/contents/gaussian_elimination/code/cpp/gaussian_elimination.cpp similarity index 100% rename from contents/gaussian_elimination/code/c++/gaussian_elimination.cpp rename to contents/gaussian_elimination/code/cpp/gaussian_elimination.cpp diff --git a/contents/gaussian_elimination/gaussian_elimination.md b/contents/gaussian_elimination/gaussian_elimination.md index 7f8e005af..8caf869ed 100644 --- a/contents/gaussian_elimination/gaussian_elimination.md +++ b/contents/gaussian_elimination/gaussian_elimination.md @@ -315,7 +315,7 @@ In code, this process might look like this: [import:5-13, lang:"c"](code/c/gaussian_elimination.c) [import:19-34, lang:"c"](code/c/gaussian_elimination.c) {% sample lang="cpp" %} -[import:13-23, lang:"cpp"](code/c++/gaussian_elimination.cpp) +[import:13-23, lang:"cpp"](code/cpp/gaussian_elimination.cpp) {% sample lang="hs" %} [import:10-17, lang:"haskell"](code/haskell/gaussianElimination.hs) [import:44-46, lang:"haskell"](code/haskell/gaussianElimination.hs) @@ -389,7 +389,7 @@ Here is what it might look like in code: {% sample lang="c" %} [import:36-41, lang:"c"](code/c/gaussian_elimination.c) {% sample lang="cpp" %} -[import:25-32, lang:"cpp"](code/c++/gaussian_elimination.cpp) +[import:25-32, lang:"cpp"](code/cpp/gaussian_elimination.cpp) {% sample lang="hs" %} [import:19-33, lang:"haskell"](code/haskell/gaussianElimination.hs) [import:42-42, lang:"haskell"](code/haskell/gaussianElimination.hs) @@ -412,7 +412,7 @@ When we put everything together, it looks like this: {% sample lang="c" %} [import:15-48, lang:"c"](code/c/gaussian_elimination.c) {% sample lang="cpp" %} -[import:8-34, lang:"cpp"](code/c++/gaussian_elimination.cpp) +[import:8-34, lang:"cpp"](code/cpp/gaussian_elimination.cpp) {% sample lang="hs" %} [import:10-36, lang:"haskell"](code/haskell/gaussianElimination.hs) {% sample lang="py" %} @@ -453,7 +453,7 @@ Here it is in code: {% sample lang="c" %} [import:64-82, lang:"c"](code/c/gaussian_elimination.c) {% sample lang="cpp" %} -[import:36-54, lang:"cpp"](code/c++/gaussian_elimination.cpp) +[import:36-54, lang:"cpp"](code/cpp/gaussian_elimination.cpp) {% sample lang="hs" %} [import:38-46, lang:"haskell"](code/haskell/gaussianElimination.hs) {% sample lang="py" %} @@ -497,7 +497,7 @@ In code, it looks like this: {% sample lang="c" %} [import:50-62, lang:"c"](code/c/gaussian_elimination.c) {% sample lang="cpp" %} -[import:56-72, lang:"cpp"](code/c++/gaussian_elimination.cpp) +[import:56-72, lang:"cpp"](code/cpp/gaussian_elimination.cpp) {% sample lang="rs" %} [import:98-112, lang:"rust"](code/rust/gaussian_elimination.rs) {% sample lang="hs" %} @@ -567,7 +567,7 @@ Here's a video describing Gaussian elimination: {% sample lang="c" %} [import, lang:"c"](code/c/gaussian_elimination.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/gaussian_elimination.cpp) +[import, lang:"cpp"](code/cpp/gaussian_elimination.cpp) {% sample lang="rs" %} [import, lang:"rust"](code/rust/gaussian_elimination.rs) {% sample lang="hs" %} diff --git a/contents/graham_scan/code/c++/graham_scan.cpp b/contents/graham_scan/code/cpp/graham_scan.cpp similarity index 100% rename from contents/graham_scan/code/c++/graham_scan.cpp rename to contents/graham_scan/code/cpp/graham_scan.cpp diff --git a/contents/graham_scan/code/golang/graham.go b/contents/graham_scan/code/go/graham.go similarity index 100% rename from contents/graham_scan/code/golang/graham.go rename to contents/graham_scan/code/go/graham.go diff --git a/contents/graham_scan/graham_scan.md b/contents/graham_scan/graham_scan.md index 586d209db..7b84f3acd 100644 --- a/contents/graham_scan/graham_scan.md +++ b/contents/graham_scan/graham_scan.md @@ -23,13 +23,13 @@ We can find whether a rotation is counter-clockwise with trigonometric functions {% sample lang="py" %} [import:4-6, lang:"python"](code/python/graham_scan.py) {% sample lang="go" %} -[import:13-15, lang:"go"](code/golang/graham.go) +[import:13-15, lang:"go"](code/go/graham.go) {% sample lang="java" %} [import:27-29, lang:"java"](code/java/GrahamScan.java) {% sample lang="lisp" %} [import:5-13, lang:"lisp"](code/clisp/graham-scan.lisp) {% sample lang="cpp" %} -[import:18-20, lang="cpp"](code/c++/graham_scan.cpp) +[import:18-20, lang="cpp"](code/cpp/graham_scan.cpp) {% sample lang="coco" %} [import:4-8, lang="coconut"](code/coconut/graham_scan.coco) {% endmethod %} @@ -57,13 +57,13 @@ In the end, the code should look something like this: {% sample lang="py" %} [import:14-28, lang:"python"](code/python/graham_scan.py) {% sample lang="go" %} -[import:21-42, lang:"go"](code/golang/graham.go) +[import:21-42, lang:"go"](code/go/graham.go) {% sample lang="java" %} [import:35-70, lang:"java"](code/java/GrahamScan.java) {% sample lang="lisp" %} [import:15-58, lang:"lisp"](code/clisp/graham-scan.lisp) {% sample lang="cpp" %} -[import:26-62, lang="cpp"](code/c++/graham_scan.cpp) +[import:26-62, lang="cpp"](code/cpp/graham_scan.cpp) {% sample lang="coco" %} [import:17-30, lang="coconut"](code/coconut/graham_scan.coco) {% endmethod %} @@ -86,13 +86,13 @@ In the end, the code should look something like this: {% sample lang="py" %} [import, lang:"python"](code/python/graham_scan.py) {% sample lang="go" %} -[import, lang:"go"](code/golang/graham.go) +[import, lang:"go"](code/go/graham.go) {% sample lang="java" %} [import, lang:"java"](code/java/GrahamScan.java) {% sample lang="lisp" %} [import, lang:"lisp"](code/clisp/graham-scan.lisp) {% sample lang="cpp" %} -[import, lang="cpp"](code/c++/graham_scan.cpp) +[import, lang="cpp"](code/cpp/graham_scan.cpp) {%sample lang="coco" %} [import, lang="coconut"](code/coconut/graham_scan.coco) {% endmethod %} diff --git a/contents/huffman_encoding/code/c++/huffman.cpp b/contents/huffman_encoding/code/cpp/huffman.cpp similarity index 100% rename from contents/huffman_encoding/code/c++/huffman.cpp rename to contents/huffman_encoding/code/cpp/huffman.cpp diff --git a/contents/huffman_encoding/code/golang/huffman.go b/contents/huffman_encoding/code/go/huffman.go similarity index 100% rename from contents/huffman_encoding/code/golang/huffman.go rename to contents/huffman_encoding/code/go/huffman.go diff --git a/contents/huffman_encoding/huffman_encoding.md b/contents/huffman_encoding/huffman_encoding.md index 44bc1e783..3772c97ca 100644 --- a/contents/huffman_encoding/huffman_encoding.md +++ b/contents/huffman_encoding/huffman_encoding.md @@ -78,7 +78,7 @@ Whether you use a stack or straight-up recursion also depends on the language, b {% sample lang="lua" %} [import, lang="lua"](code/lua/huffman.lua) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/huffman.cpp) +[import, lang:"cpp"](code/cpp/huffman.cpp) {% sample lang="clj" %} [import, lang:"clojure"](code/clojure/huffman.clj) {% sample lang="py" %} @@ -88,7 +88,7 @@ Whether you use a stack or straight-up recursion also depends on the language, b {% sample lang="java" %} [import, lang:"java"](code/java/huffman.java) {% sample lang="go" %} -[import, lang:"go"](code/golang/huffman.go) +[import, lang:"go"](code/go/huffman.go) {% sample lang="asm-x64" %} [import, lang:"asm-x64"](code/asm-x64/huffman.s) {% sample lang="scala" %} diff --git a/contents/jarvis_march/code/c++/jarvis_march.cpp b/contents/jarvis_march/code/cpp/jarvis_march.cpp similarity index 100% rename from contents/jarvis_march/code/c++/jarvis_march.cpp rename to contents/jarvis_march/code/cpp/jarvis_march.cpp diff --git a/contents/jarvis_march/code/golang/jarvis.go b/contents/jarvis_march/code/go/jarvis.go similarity index 100% rename from contents/jarvis_march/code/golang/jarvis.go rename to contents/jarvis_march/code/go/jarvis.go diff --git a/contents/jarvis_march/jarvis_march.md b/contents/jarvis_march/jarvis_march.md index fa244713e..20929d4ad 100644 --- a/contents/jarvis_march/jarvis_march.md +++ b/contents/jarvis_march/jarvis_march.md @@ -39,13 +39,13 @@ Since this algorithm, there have been many other algorithms that have advanced t {% sample lang="py" %} [import, lang:"python"](code/python/jarvis_march.py) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/jarvis_march.cpp) +[import, lang:"cpp"](code/cpp/jarvis_march.cpp) {% sample lang="lisp" %} [import, lang:"lisp"](code/clisp/jarvis-march.lisp) {% sample lang="java" %} [import, lang:"java"](code/java/JarvisMarch.java) {% sample lang="go" %} -[import, lang:"go"](code/golang/jarvis.go) +[import, lang:"go"](code/go/jarvis.go) {% sample lang="v" %} [import, lang:"v"](code/v/jarvis.v) {% sample lang="rust" %} diff --git a/contents/monte_carlo_integration/code/c++/monte_carlo.cpp b/contents/monte_carlo_integration/code/cpp/monte_carlo.cpp similarity index 100% rename from contents/monte_carlo_integration/code/c++/monte_carlo.cpp rename to contents/monte_carlo_integration/code/cpp/monte_carlo.cpp diff --git a/contents/monte_carlo_integration/monte_carlo_integration.md b/contents/monte_carlo_integration/monte_carlo_integration.md index cf5640ffa..964de7bbe 100644 --- a/contents/monte_carlo_integration/monte_carlo_integration.md +++ b/contents/monte_carlo_integration/monte_carlo_integration.md @@ -44,7 +44,7 @@ each point is tested to see whether it's in the circle or not: {% sample lang="c" %} [import:7-9, lang:"c"](code/c/monte_carlo.c) {% sample lang="cpp" %} -[import:7-16, lang:"cpp"](code/c++/monte_carlo.cpp) +[import:7-16, lang:"cpp"](code/cpp/monte_carlo.cpp) {% sample lang="js" %} [import:2-6, lang:"javascript"](code/javascript/monte_carlo.js) {% sample lang="hs" %} @@ -147,7 +147,7 @@ Feel free to submit your version via pull request, and thanks for reading! {% sample lang="c" %} [import, lang:"c"](code/c/monte_carlo.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/monte_carlo.cpp) +[import, lang:"cpp"](code/cpp/monte_carlo.cpp) {% sample lang="js" %} [import, lang:"javascript"](code/javascript/monte_carlo.js) {% sample lang="hs" %} diff --git a/contents/quantum_systems/quantum_systems.md b/contents/quantum_systems/quantum_systems.md index a7a762ca5..c602aaea1 100644 --- a/contents/quantum_systems/quantum_systems.md +++ b/contents/quantum_systems/quantum_systems.md @@ -232,7 +232,7 @@ This ultimately looks like this: {% sample lang="c" %} [import:150-184, lang:"c"](../split-operator_method/code/c/split_op.c) {% sample lang="cpp" %} -[import:158-189, lang:"cpp"](../split-operator_method/code/c++/split_op.cpp) +[import:158-189, lang:"cpp"](../split-operator_method/code/cpp/split_op.cpp) {% sample lang="py" %} [import:98-112, lang:"python"](../split-operator_method/code/python/split_op.py) {% endmethod %} diff --git a/contents/split-operator_method/code/c++/split_op.cpp b/contents/split-operator_method/code/cpp/split_op.cpp similarity index 100% rename from contents/split-operator_method/code/c++/split_op.cpp rename to contents/split-operator_method/code/cpp/split_op.cpp diff --git a/contents/split-operator_method/split-operator_method.md b/contents/split-operator_method/split-operator_method.md index 33af1f225..ad4fd6c0e 100644 --- a/contents/split-operator_method/split-operator_method.md +++ b/contents/split-operator_method/split-operator_method.md @@ -103,7 +103,7 @@ Regardless, we first need to set all the initial parameters, including the initi [import:11-21, lang:"c"](code/c/split_op.c) [import:52-73, lang:"c"](code/c/split_op.c) {% sample lang="cpp" %} -[import:14-49, lang:"cpp"](code/c++/split_op.cpp) +[import:14-49, lang:"cpp"](code/cpp/split_op.cpp) {% sample lang="py" %} [import:11-30, lang:"python"](code/python/split_op.py) {% sample lang="hs" %} @@ -126,7 +126,7 @@ Afterwards, we turn them into operators: [import:23-29, lang:"c"](code/c/split_op.c) [import:75-96, lang:"c"](code/c/split_op.c) {% sample lang="cpp" %} -[import:51-80, lang:"cpp"](code/c++/split_op.cpp) +[import:51-80, lang:"cpp"](code/cpp/split_op.cpp) {% sample lang="py" %} [import:33-54, lang:"python"](code/python/split_op.py) {% sample lang="hs" %} @@ -149,7 +149,7 @@ The final step is to do the iteration, itself. {% sample lang="c" %} [import:98-148, lang:"c"](code/c/split_op.c) {% sample lang="cpp" %} -[import:99-156, lang:"cpp"](code/c++/split_op.cpp) +[import:99-156, lang:"cpp"](code/cpp/split_op.cpp) {% sample lang="py" %} [import:57-95, lang:"python"](code/python/split_op.py) {% sample lang="hs" %} @@ -186,7 +186,7 @@ Checking to make sure your code can output the correct energy for a harmonic tra {% sample lang="c" %} [import, lang:"c"](code/c/split_op.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/split_op.cpp) +[import, lang:"cpp"](code/cpp/split_op.cpp) {% sample lang="py" %} [import:5-127, lang:"python"](code/python/split_op.py) {% sample lang="hs" %} diff --git a/contents/stable_marriage_problem/code/c++/stable_marriage.cpp b/contents/stable_marriage_problem/code/cpp/stable_marriage.cpp similarity index 100% rename from contents/stable_marriage_problem/code/c++/stable_marriage.cpp rename to contents/stable_marriage_problem/code/cpp/stable_marriage.cpp diff --git a/contents/stable_marriage_problem/stable_marriage_problem.md b/contents/stable_marriage_problem/stable_marriage_problem.md index 3121c6478..2e8850a01 100644 --- a/contents/stable_marriage_problem/stable_marriage_problem.md +++ b/contents/stable_marriage_problem/stable_marriage_problem.md @@ -40,7 +40,7 @@ Here is a video describing the stable marriage problem: {% sample lang="c" %} [import, lang:"c"](code/c/stable_marriage.c) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/stable_marriage.cpp) +[import, lang:"cpp"](code/cpp/stable_marriage.cpp) {% sample lang="js" %} [import, lang:"javascript"](code/javascript/stable-marriage.js) {% sample lang="cs" %} diff --git a/contents/thomas_algorithm/code/c++/thomas.cpp b/contents/thomas_algorithm/code/cpp/thomas.cpp similarity index 100% rename from contents/thomas_algorithm/code/c++/thomas.cpp rename to contents/thomas_algorithm/code/cpp/thomas.cpp diff --git a/contents/thomas_algorithm/code/golang/thomas.go b/contents/thomas_algorithm/code/go/thomas.go similarity index 100% rename from contents/thomas_algorithm/code/golang/thomas.go rename to contents/thomas_algorithm/code/go/thomas.go diff --git a/contents/thomas_algorithm/thomas_algorithm.md b/contents/thomas_algorithm/thomas_algorithm.md index 5af6c3334..81bb47617 100644 --- a/contents/thomas_algorithm/thomas_algorithm.md +++ b/contents/thomas_algorithm/thomas_algorithm.md @@ -112,7 +112,7 @@ You will find this algorithm implemented [in this project](https://scratch.mit.e {% sample lang="hs" %} [import, lang:"haskell"](code/haskell/thomas.hs) {% sample lang="go" %} -[import, lang:"go"](code/golang/thomas.go) +[import, lang:"go"](code/go/thomas.go) {% sample lang="v" %} [import, lang:"v"](code/v/thomas.v) {% sample lang="swift" %} @@ -122,7 +122,7 @@ You will find this algorithm implemented [in this project](https://scratch.mit.e {% sample lang="nim" %} [import, lang:"nim"](code/nim/thomas_algorithm.nim) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/thomas.cpp) +[import, lang:"cpp"](code/cpp/thomas.cpp) {% sample lang="lua" %} [import, lang:"lua"](code/lua/thomas.lua) {% sample lang="crystal" %} diff --git a/contents/tree_traversal/code/c++/tree_example.cpp b/contents/tree_traversal/code/cpp/tree_example.cpp similarity index 100% rename from contents/tree_traversal/code/c++/tree_example.cpp rename to contents/tree_traversal/code/cpp/tree_example.cpp diff --git a/contents/tree_traversal/code/golang/treetraversal.go b/contents/tree_traversal/code/go/treetraversal.go similarity index 100% rename from contents/tree_traversal/code/golang/treetraversal.go rename to contents/tree_traversal/code/go/treetraversal.go diff --git a/contents/tree_traversal/tree_traversal.md b/contents/tree_traversal/tree_traversal.md index 4b6c5b762..5dc6657e0 100644 --- a/contents/tree_traversal/tree_traversal.md +++ b/contents/tree_traversal/tree_traversal.md @@ -6,7 +6,7 @@ Trees are naturally recursive data structures, and because of this, we cannot ac {% sample lang="jl" %} [import:3-7, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import:12-15, lang:"cpp"](code/c++/tree_example.cpp) +[import:12-15, lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} [import:6-10, lang:"csharp"](code/csharp/Tree.cs) {% sample lang="c" %} @@ -35,7 +35,7 @@ As a note, a `node` struct is not necessary in javascript, so this is an example {% sample lang="st" %} [import:1-20, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import:5-8, lang:"go"](code/golang/treetraversal.go) +[import:5-8, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import:24-27, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} @@ -54,7 +54,7 @@ Because of this, the most straightforward way to traverse the tree might be recu {% sample lang="jl" %} [import:9-16, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import:17-24, lang:"cpp"](code/c++/tree_example.cpp) +[import:17-24, lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} [import:33-44, lang:"csharp"](code/csharp/Tree.cs) {% sample lang="c" %} @@ -82,7 +82,7 @@ Because of this, the most straightforward way to traverse the tree might be recu {% sample lang="st" %} [import:22-27, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import:10-15, lang:"go"](code/golang/treetraversal.go) +[import:10-15, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import:290-314, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} @@ -110,7 +110,7 @@ Now, in this case the first element searched through is still the root of the tr {% sample lang="jl" %} [import:18-26, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import:26-31, lang:"cpp"](code/c++/tree_example.cpp) +[import:26-31, lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} [import:46-57, lang:"csharp"](code/csharp/Tree.cs) {% sample lang="c" %} @@ -138,7 +138,7 @@ Now, in this case the first element searched through is still the root of the tr {% sample lang="st" %} [import:29-34, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import:17-22, lang:"go"](code/golang/treetraversal.go) +[import:17-22, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import:316-344, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} @@ -161,7 +161,7 @@ In this case, the first node visited is at the bottom of the tree and moves up t {% sample lang="jl" %} [import:28-43, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import:34-52 lang:"cpp"](code/c++/tree_example.cpp) +[import:34-52 lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} [import:59-83, lang:"csharp"](code/csharp/Tree.cs) {% sample lang="c" %} @@ -189,7 +189,7 @@ In this case, the first node visited is at the bottom of the tree and moves up t {% sample lang="st" %} [import:36-49, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import:24-38, lang:"go"](code/golang/treetraversal.go) +[import:24-38, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import:346-396, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} @@ -221,7 +221,7 @@ In code, it looks like this: {% sample lang="jl" %} [import:45-56, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import:55-70, lang:"cpp"](code/c++/tree_example.cpp) +[import:55-70, lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} [import:85-98, lang:"csharp"](code/csharp/Tree.cs) {% sample lang="c" %} @@ -249,7 +249,7 @@ In code, it looks like this: {% sample lang="st" %} [import:47-58, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import:40-49, lang:"go"](code/golang/treetraversal.go) +[import:40-49, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import:398-445, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} @@ -274,7 +274,7 @@ And this is exactly what Breadth-First Search (BFS) does! On top of that, it can {% sample lang="jl" %} [import:58-69, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import:73-86, lang:"cpp"](code/c++/tree_example.cpp) +[import:73-86, lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} [import:100-113, lang:"csharp"](code/csharp/Tree.cs) {% sample lang="c" %} @@ -302,7 +302,7 @@ And this is exactly what Breadth-First Search (BFS) does! On top of that, it can {% sample lang="st" %} [import:60-71, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import:51-60, lang:"go"](code/golang/treetraversal.go) +[import:51-60, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import:447-498, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} @@ -328,7 +328,7 @@ Here is a video describing tree traversal: {% sample lang="jl" %} [import, lang:"julia"](code/julia/Tree.jl) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/tree_example.cpp) +[import, lang:"cpp"](code/cpp/tree_example.cpp) {% sample lang="cs" %} ##### Tree.cs [import, lang:"csharp"](code/csharp/Tree.cs) @@ -366,7 +366,7 @@ The code snippets were taken from this [Scratch project](https://scratch.mit.edu {% sample lang="st" %} [import, lang:"smalltalk"](code/smalltalk/tree_traversal.st) {% sample lang="go" %} -[import, lang:"go"](code/golang/treetraversal.go) +[import, lang:"go"](code/go/treetraversal.go) {% sample lang="asm-x64" %} [import, lang:"asm-x64"](code/asm-x64/tree_traversal.s) {% sample lang="emojic" %} diff --git a/contents/verlet_integration/code/c++/verlet.cpp b/contents/verlet_integration/code/cpp/verlet.cpp similarity index 100% rename from contents/verlet_integration/code/c++/verlet.cpp rename to contents/verlet_integration/code/cpp/verlet.cpp diff --git a/contents/verlet_integration/code/golang/verlet.go b/contents/verlet_integration/code/go/verlet.go similarity index 100% rename from contents/verlet_integration/code/golang/verlet.go rename to contents/verlet_integration/code/go/verlet.go diff --git a/contents/verlet_integration/verlet_integration.md b/contents/verlet_integration/verlet_integration.md index 08fe4a4b3..80d719bef 100644 --- a/contents/verlet_integration/verlet_integration.md +++ b/contents/verlet_integration/verlet_integration.md @@ -33,7 +33,7 @@ Here is what it looks like in code: {% sample lang="jl" %} [import:1-13, lang:"julia"](code/julia/verlet.jl) {% sample lang="cpp" %} -[import:9-22, lang:"cpp"](code/c++/verlet.cpp) +[import:9-22, lang:"cpp"](code/cpp/verlet.cpp) {% sample lang="c" %} [import:3-14, lang:"c"](code/c/verlet.c) {% sample lang="java" %} @@ -53,7 +53,7 @@ Here is what it looks like in code: {% sample lang="ruby" %} [import:1-14, lang="ruby"](code/ruby/verlet.rb) {% sample lang="go" %} -[import:5-16, lang:"go"](code/golang/verlet.go) +[import:5-16, lang:"go"](code/go/verlet.go) {% sample lang="asm-x64" %} [import:18-42, lang:"asm-x64"](code/asm-x64/verlet.s) {% sample lang="kotlin" %} @@ -82,7 +82,7 @@ However, the error for this is $$\mathcal{O}(\Delta t)$$, which is quite poor, b {% sample lang="jl" %} [import:15-31, lang:"julia"](code/julia/verlet.jl) {% sample lang="cpp" %} -[import:24-41, lang:"cpp"](code/c++/verlet.cpp) +[import:24-41, lang:"cpp"](code/cpp/verlet.cpp) {% sample lang="c" %} [import:16-31, lang:"c"](code/c/verlet.c) {% sample lang="java" %} @@ -102,7 +102,7 @@ However, the error for this is $$\mathcal{O}(\Delta t)$$, which is quite poor, b {% sample lang="ruby" %} [import:16-32, lang="ruby"](code/ruby/verlet.rb) {% sample lang="go" %} -[import:18-30, lang:"go"](code/golang/verlet.go) +[import:18-30, lang:"go"](code/go/verlet.go) {% sample lang="asm-x64" %} [import:44-71, lang:"asm-x64"](code/asm-x64/verlet.s) {% sample lang="kotlin" %} @@ -145,7 +145,7 @@ Here is the velocity Verlet method in code: {% sample lang="jl" %} [import:33-45, lang:"julia"](code/julia/verlet.jl) {% sample lang="cpp" %} -[import:43-54, lang:"cpp"](code/c++/verlet.cpp) +[import:43-54, lang:"cpp"](code/cpp/verlet.cpp) {% sample lang="c" %} [import:33-43, lang:"c"](code/c/verlet.c) {% sample lang="java" %} @@ -165,7 +165,7 @@ Here is the velocity Verlet method in code: {% sample lang="ruby" %} [import:34-46, lang="ruby"](code/ruby/verlet.rb) {% sample lang="go" %} -[import:32-42, lang:"go"](code/golang/verlet.go) +[import:32-42, lang:"go"](code/go/verlet.go) {% sample lang="asm-x64" %} [import:73-101, lang:"asm-x64"](code/asm-x64/verlet.s) {% sample lang="kotlin" %} @@ -194,7 +194,7 @@ Both of these methods work simply by iterating timestep-by-timestep and can be w {% sample lang="jl" %} [import, lang:"julia"](code/julia/verlet.jl) {% sample lang="cpp" %} -[import, lang:"cpp"](code/c++/verlet.cpp) +[import, lang:"cpp"](code/cpp/verlet.cpp) {% sample lang="c" %} [import, lang:"c"](code/c/verlet.c) {% sample lang="java" %} @@ -214,7 +214,7 @@ Both of these methods work simply by iterating timestep-by-timestep and can be w {% sample lang="ruby" %} [import, lang="ruby"](code/ruby/verlet.rb) {% sample lang="go" %} -[import, lang:"go"](code/golang/verlet.go) +[import, lang:"go"](code/go/verlet.go) {% sample lang="asm-x64" %} [import, lang:"asm-x64"](code/asm-x64/verlet.s) {% sample lang="kotlin" %}