Skip to content

Commit

Permalink
Standardise code directory names (#920)
Browse files Browse the repository at this point in the history
* Rename c++ directories to cpp

* Rename golang folders to go

* Change paths to code in chapter files

Co-authored-by: James Schloss <[email protected]>
  • Loading branch information
ShadowMitia and leios authored Nov 7, 2021
1 parent a3825b2 commit 7fe5bfe
Show file tree
Hide file tree
Showing 42 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions contents/IFS/IFS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion contents/approximate_counting/approximate_counting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion contents/barnsley/barnsley.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion contents/computus/computus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions contents/cooley_tukey/cooley_tukey.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down
6 changes: 3 additions & 3 deletions contents/euclidean_algorithm/euclidean_algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down
4 changes: 2 additions & 2 deletions contents/forward_euler_method/forward_euler_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand All @@ -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" %}
Expand Down
12 changes: 6 additions & 6 deletions contents/gaussian_elimination/gaussian_elimination.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions contents/graham_scan/graham_scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand All @@ -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 %}
Expand Down
4 changes: 2 additions & 2 deletions contents/huffman_encoding/huffman_encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand All @@ -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" %}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions contents/jarvis_march/jarvis_march.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down
4 changes: 2 additions & 2 deletions contents/monte_carlo_integration/monte_carlo_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down
2 changes: 1 addition & 1 deletion contents/quantum_systems/quantum_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
8 changes: 4 additions & 4 deletions contents/split-operator_method/split-operator_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand All @@ -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" %}
Expand All @@ -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" %}
Expand Down Expand Up @@ -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" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions contents/thomas_algorithm/thomas_algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand All @@ -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" %}
Expand Down
Loading

0 comments on commit 7fe5bfe

Please sign in to comment.