Skip to content

Commit dff02ab

Browse files
committed
reformat chapters
1 parent dd2d70e commit dff02ab

File tree

8 files changed

+63
-9
lines changed

8 files changed

+63
-9
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
The book has been divided into sections for easy addition and removal of questions
44

5+
I have left `chapter 8` empty (changing names is boring)
6+
57
You might wanna read [mdbook guide](https://rust-lang-nursery.github.io/mdBook/) before contributing
68

79
All the questions are in the following format `src/chapterX/questions.md`

book/index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</script>
7676

7777
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
78-
<ol class="chapter"><li class="affix"><a href="about.html">About</a></li><li class="affix"><a href="FAQs.html">FAQs</a></li><li class="affix"><a href="RESOURCES.html">Learning Resources</a></li><li><a href="chapter_1-basics/questions.html"><strong aria-hidden="true">1.</strong> Chapter 1 - Basics</a></li><li><a href="chapter_2-expressions/questions.html"><strong aria-hidden="true">2.</strong> Chapter 2 - Expressions</a></li><li><a href="chapter_3-structs/questions.html"><strong aria-hidden="true">3.</strong> Chapter 3 - Structs</a></li><li><a href="chapter_4-enum&patterns/questions.html"><strong aria-hidden="true">4.</strong> Chapter 4 - Enum &amp; Patterns</a></li><li><a href="chapter_5-traits&generics/questions.html"><strong aria-hidden="true">5.</strong> Chapter 5 - Traits &amp; Generics</a></li><li><a href="chapter_6-operatoroverloading/questions.html"><strong aria-hidden="true">6.</strong> Chapter 6 - Operator Overloading</a></li><li><a href="chapter_7-closures/questions.html"><strong aria-hidden="true">7.</strong> Chapter 7 - Closures</a></li><li><a href="chapter_8-iterators/questions.html"><strong aria-hidden="true">8.</strong> Chapter 8 - Iterators</a></li><li><a href="chapter_9-collections/questions.html"><strong aria-hidden="true">9.</strong> Chapter 9 - Collections</a></li><li><a href="chapter_10-input&output/questions.html"><strong aria-hidden="true">10.</strong> Chapter 10 - Input &amp; Output</a></li><li><a href="chapter_11-macros/questions.html"><strong aria-hidden="true">11.</strong> Chapter 11 - Macros</a></li><li><a href="chapter_12-concurrency/questions.html"><strong aria-hidden="true">12.</strong> Chapter 12 - Concurrency</a></li><li><a href="chapter_miscellaneous/questions.html"><strong aria-hidden="true">13.</strong> Chapter - Miscellaneous</a></li></ol>
78+
<ol class="chapter"><li class="affix"><a href="about.html">About</a></li><li class="affix"><a href="FAQs.html">FAQs</a></li><li class="affix"><a href="RESOURCES.html">Learning Resources</a></li><li><a href="chapter_1-basics/questions.html"><strong aria-hidden="true">1.</strong> Chapter 1 - Basics</a></li><li><a href="chapter_2-expressions/questions.html"><strong aria-hidden="true">2.</strong> Chapter 2 - Expressions</a></li><li><a href="chapter_3-structs/questions.html"><strong aria-hidden="true">3.</strong> Chapter 3 - Structs</a></li><li><a href="chapter_4-enum&patterns/questions.html"><strong aria-hidden="true">4.</strong> Chapter 4 - Enum &amp; Patterns</a></li><li><a href="chapter_5-traits&generics/questions.html"><strong aria-hidden="true">5.</strong> Chapter 5 - Traits &amp; Generics</a></li><li><a href="chapter_6-operatoroverloading&utility/questions.html"><strong aria-hidden="true">6.</strong> Chapter 6 - Operator Overloading &amp; Utility Traits</a></li><li><a href="chapter_7-closures&iterators/questions.html"><strong aria-hidden="true">7.</strong> Chapter 7 - Closures &amp; Iterators</a></li><li><a href="chapter_9-collections/questions.html"><strong aria-hidden="true">8.</strong> Chapter 8 - Collections</a></li><li><a href="chapter_10-input&output/questions.html"><strong aria-hidden="true">9.</strong> Chapter 9 - Input &amp; Output</a></li><li><a href="chapter_11-macros/questions.html"><strong aria-hidden="true">10.</strong> Chapter 10 - Macros</a></li><li><a href="chapter_12-concurrency/questions.html"><strong aria-hidden="true">11.</strong> Chapter 11 - Concurrency</a></li><li><a href="chapter_miscellaneous/questions.html"><strong aria-hidden="true">12.</strong> Chapter - Miscellaneous</a></li></ol>
7979
</nav>
8080

8181
<div id="page-wrapper" class="page-wrapper">
@@ -168,6 +168,21 @@ <h1 class="menu-title">Jang</h1>
168168
</div>
169169

170170

171+
<!-- Livereload script (if served using the cli tool) -->
172+
<script type="text/javascript">
173+
var socket = new WebSocket("ws://localhost:3001");
174+
socket.onmessage = function (event) {
175+
if (event.data === "reload") {
176+
socket.close();
177+
location.reload(true); // force reload from server (not from cache)
178+
}
179+
};
180+
181+
window.onbeforeunload = function() {
182+
socket.close();
183+
}
184+
</script>
185+
171186

172187

173188
<!-- Google Analytics Tag -->

book/print.html

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</script>
7676

7777
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
78-
<ol class="chapter"><li class="affix"><a href="about.html">About</a></li><li class="affix"><a href="FAQs.html">FAQs</a></li><li class="affix"><a href="RESOURCES.html">Learning Resources</a></li><li><a href="chapter_1-basics/questions.html"><strong aria-hidden="true">1.</strong> Chapter 1 - Basics</a></li><li><a href="chapter_2-expressions/questions.html"><strong aria-hidden="true">2.</strong> Chapter 2 - Expressions</a></li><li><a href="chapter_3-structs/questions.html"><strong aria-hidden="true">3.</strong> Chapter 3 - Structs</a></li><li><a href="chapter_4-enum&patterns/questions.html"><strong aria-hidden="true">4.</strong> Chapter 4 - Enum &amp; Patterns</a></li><li><a href="chapter_5-traits&generics/questions.html"><strong aria-hidden="true">5.</strong> Chapter 5 - Traits &amp; Generics</a></li><li><a href="chapter_6-operatoroverloading/questions.html"><strong aria-hidden="true">6.</strong> Chapter 6 - Operator Overloading</a></li><li><a href="chapter_7-closures/questions.html"><strong aria-hidden="true">7.</strong> Chapter 7 - Closures</a></li><li><a href="chapter_8-iterators/questions.html"><strong aria-hidden="true">8.</strong> Chapter 8 - Iterators</a></li><li><a href="chapter_9-collections/questions.html"><strong aria-hidden="true">9.</strong> Chapter 9 - Collections</a></li><li><a href="chapter_10-input&output/questions.html"><strong aria-hidden="true">10.</strong> Chapter 10 - Input &amp; Output</a></li><li><a href="chapter_11-macros/questions.html"><strong aria-hidden="true">11.</strong> Chapter 11 - Macros</a></li><li><a href="chapter_12-concurrency/questions.html"><strong aria-hidden="true">12.</strong> Chapter 12 - Concurrency</a></li><li><a href="chapter_miscellaneous/questions.html"><strong aria-hidden="true">13.</strong> Chapter - Miscellaneous</a></li></ol>
78+
<ol class="chapter"><li class="affix"><a href="about.html">About</a></li><li class="affix"><a href="FAQs.html">FAQs</a></li><li class="affix"><a href="RESOURCES.html">Learning Resources</a></li><li><a href="chapter_1-basics/questions.html"><strong aria-hidden="true">1.</strong> Chapter 1 - Basics</a></li><li><a href="chapter_2-expressions/questions.html"><strong aria-hidden="true">2.</strong> Chapter 2 - Expressions</a></li><li><a href="chapter_3-structs/questions.html"><strong aria-hidden="true">3.</strong> Chapter 3 - Structs</a></li><li><a href="chapter_4-enum&patterns/questions.html"><strong aria-hidden="true">4.</strong> Chapter 4 - Enum &amp; Patterns</a></li><li><a href="chapter_5-traits&generics/questions.html"><strong aria-hidden="true">5.</strong> Chapter 5 - Traits &amp; Generics</a></li><li><a href="chapter_6-operatoroverloading&utility/questions.html"><strong aria-hidden="true">6.</strong> Chapter 6 - Operator Overloading &amp; Utility Traits</a></li><li><a href="chapter_7-closures&iterators/questions.html"><strong aria-hidden="true">7.</strong> Chapter 7 - Closures &amp; Iterators</a></li><li><a href="chapter_9-collections/questions.html"><strong aria-hidden="true">8.</strong> Chapter 8 - Collections</a></li><li><a href="chapter_10-input&output/questions.html"><strong aria-hidden="true">9.</strong> Chapter 9 - Input &amp; Output</a></li><li><a href="chapter_11-macros/questions.html"><strong aria-hidden="true">10.</strong> Chapter 10 - Macros</a></li><li><a href="chapter_12-concurrency/questions.html"><strong aria-hidden="true">11.</strong> Chapter 11 - Concurrency</a></li><li><a href="chapter_miscellaneous/questions.html"><strong aria-hidden="true">12.</strong> Chapter - Miscellaneous</a></li></ol>
7979
</nav>
8080

8181
<div id="page-wrapper" class="page-wrapper">
@@ -387,6 +387,21 @@ <h1 class="menu-title">Jang</h1>
387387
<p>Create a struct named <code>Class</code> that contains the class size, section and grade. Overload
388388
the <code>&gt;</code>, <code>&lt;</code>, <code>&gt;=</code>, <code>&lt;=</code>, <code>==</code> operators to compare class sizes of various Classes.</p>
389389
</li>
390+
<li>
391+
<p>Rust does not allow addition of <code>integer</code> and <code>float</code>. Overload <code>+</code> so that this is possible.</p>
392+
</li>
393+
</ul>
394+
<ul>
395+
<li>
396+
<p>Create a closer <code>add_one</code> to add 1 to an integer.</p>
397+
</li>
398+
<li>
399+
<p>Create an vec of numbers from <code>0</code> ... <code>100</code>, mutate the vec so that
400+
it does not contain any number divisible by <code>3</code>. Use <code>retain</code> method of Vec.</p>
401+
</li>
402+
<li>
403+
<p>Create a function that accepts a closure</p>
404+
</li>
390405
</ul>
391406
<ul>
392407
<li>Implement a macro named <code>addition</code> to add any amount of numbers. <code>Eg</code>: <code>addition!(5, 6, 57 ,56, 1)</code>
@@ -424,6 +439,21 @@ <h1 class="menu-title">Jang</h1>
424439
</div>
425440

426441

442+
<!-- Livereload script (if served using the cli tool) -->
443+
<script type="text/javascript">
444+
var socket = new WebSocket("ws://localhost:3001");
445+
socket.onmessage = function (event) {
446+
if (event.data === "reload") {
447+
socket.close();
448+
location.reload(true); // force reload from server (not from cache)
449+
}
450+
};
451+
452+
window.onbeforeunload = function() {
453+
socket.close();
454+
}
455+
</script>
456+
427457

428458

429459
<!-- Google Analytics Tag -->

src/SUMMARY.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
- [Chapter 3 - Structs](chapter_3-structs/questions.md)
99
- [Chapter 4 - Enum & Patterns](chapter_4-enum&patterns/questions.md)
1010
- [Chapter 5 - Traits & Generics](chapter_5-traits&generics/questions.md)
11-
- [Chapter 6 - Operator Overloading](chapter_6-operatoroverloading/questions.md)
12-
- [Chapter 7 - Closures](chapter_7-closures/questions.md)
13-
- [Chapter 8 - Iterators](chapter_8-iterators/questions.md)
14-
- [Chapter 9 - Collections](chapter_9-collections/questions.md)
15-
- [Chapter 10 - Input & Output](chapter_10-input&output/questions.md)
16-
- [Chapter 11 - Macros](chapter_11-macros/questions.md)
17-
- [Chapter 12 - Concurrency](chapter_12-concurrency/questions.md)
11+
- [Chapter 6 - Operator Overloading & Utility Traits](chapter_6-operatoroverloading&utility/questions.md)
12+
- [Chapter 7 - Closures & Iterators](chapter_7-closures&iterators/questions.md)
13+
- [Chapter 8 - Collections](chapter_9-collections/questions.md)
14+
- [Chapter 9 - Input & Output](chapter_10-input&output/questions.md)
15+
- [Chapter 10 - Macros](chapter_11-macros/questions.md)
16+
- [Chapter 11 - Concurrency](chapter_12-concurrency/questions.md)
1817
- [Chapter - Miscellaneous](chapter_miscellaneous/questions.md)
1918

src/chapter_6-operatoroverloading/questions.md renamed to src/chapter_6-operatoroverloading&utility/questions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ and `plus` operator to add and subtract complex number.
88

99
* Create a struct named `Class` that contains the class size, section and grade. Overload
1010
the `>`, `<`, `>=`, `<=`, `==` operators to compare class sizes of various Classes.
11+
12+
* Rust does not allow addition of `integer` and `float`. Overload `+` so that this is possible.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* Create a closer `add_one` to add 1 to an integer.
2+
3+
* Create an vec of numbers from `0` ... `100`, mutate the vec so that
4+
it does not contain any number divisible by `3`. Use `retain` method of Vec.
5+
6+
* Create a function that accepts a closure
File renamed without changes.

src/chapter_8-iterators/questions.md

Whitespace-only changes.

0 commit comments

Comments
 (0)