|
75 | 75 | </script> |
76 | 76 |
|
77 | 77 | <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 & Patterns</a></li><li><a href="chapter_5-traits&generics/questions.html"><strong aria-hidden="true">5.</strong> Chapter 5 - Traits & 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 & 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 & Patterns</a></li><li><a href="chapter_5-traits&generics/questions.html"><strong aria-hidden="true">5.</strong> Chapter 5 - Traits & Generics</a></li><li><a href="chapter_6-operatoroverloading&utility/questions.html"><strong aria-hidden="true">6.</strong> Chapter 6 - Operator Overloading & Utility Traits</a></li><li><a href="chapter_7-closures&iterators/questions.html"><strong aria-hidden="true">7.</strong> Chapter 7 - Closures & 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 & 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> |
79 | 79 | </nav> |
80 | 80 |
|
81 | 81 | <div id="page-wrapper" class="page-wrapper"> |
@@ -387,6 +387,21 @@ <h1 class="menu-title">Jang</h1> |
387 | 387 | <p>Create a struct named <code>Class</code> that contains the class size, section and grade. Overload |
388 | 388 | the <code>></code>, <code><</code>, <code>>=</code>, <code><=</code>, <code>==</code> operators to compare class sizes of various Classes.</p> |
389 | 389 | </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> |
390 | 405 | </ul> |
391 | 406 | <ul> |
392 | 407 | <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> |
424 | 439 | </div> |
425 | 440 |
|
426 | 441 |
|
| 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 | + |
427 | 457 |
|
428 | 458 |
|
429 | 459 | <!-- Google Analytics Tag --> |
|
0 commit comments