gh-pages
Dhghomon 4 years ago
parent 5b09f0de26
commit adaa1e7503

@ -167,6 +167,7 @@
<p><img src="https://github.com/Dhghomon/easy_rust/workflows/github%20pages/badge.svg" alt="example workflow name" /></p> <p><img src="https://github.com/Dhghomon/easy_rust/workflows/github%20pages/badge.svg" alt="example workflow name" /></p>
<p>22 December 2020: mdBook can be found <a href="https://dhghomon.github.io/easy_rust">here</a>.</p> <p>22 December 2020: mdBook can be found <a href="https://dhghomon.github.io/easy_rust">here</a>.</p>
<p>28 November 2020: <a href="https://github.com/kumakichi/easy_rust_chs">Now also available in simplified Chinese</a> thanks to <a href="https://github.com/kumakichi">kumakichi</a>!</p> <p>28 November 2020: <a href="https://github.com/kumakichi/easy_rust_chs">Now also available in simplified Chinese</a> thanks to <a href="https://github.com/kumakichi">kumakichi</a>!</p>
<p>1 February 2021: <a href="https://www.youtube.com/playlist?list=PLfllocyHVgsRwLkTAhG0E-2QxCf-ozBkk">Now available on YouTube!</a></p>
</main> </main>

@ -164,6 +164,7 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h2><a class="header" href="#rust-playground" id="rust-playground">Rust Playground</a></h2> <h2><a class="header" href="#rust-playground" id="rust-playground">Rust Playground</a></h2>
<p><a href="https://youtu.be/-lYeJeQ11OI">See this chapter on YouTube</a></p>
<p>Maybe you don't want to install Rust yet, and that's okay. You can go to <a href="https://play.rust-lang.org/">https://play.rust-lang.org/</a> and start writing Rust without leaving your browser. You can write your code there and click Run to see the results. You can run most of the samples in this book inside the Playground in your browser. Only near the end you will see samples that go beyond what you can do in the Playground (like opening files).</p> <p>Maybe you don't want to install Rust yet, and that's okay. You can go to <a href="https://play.rust-lang.org/">https://play.rust-lang.org/</a> and start writing Rust without leaving your browser. You can write your code there and click Run to see the results. You can run most of the samples in this book inside the Playground in your browser. Only near the end you will see samples that go beyond what you can do in the Playground (like opening files).</p>
<p>Here are some tips when using the Rust Playground:</p> <p>Here are some tips when using the Rust Playground:</p>
<ul> <ul>

@ -164,6 +164,7 @@
<div id="content" class="content"> <div id="content" class="content">
<main> <main>
<h2><a class="header" href="#comments" id="comments">Comments</a></h2> <h2><a class="header" href="#comments" id="comments">Comments</a></h2>
<p><a href="https://youtu.be/fJ7jBZG_Rpo">See this chapter on YouTube</a></p>
<p>Comments are made for programmers to read, not the computer. It's good to write comments to help other people understand your code. It's also good to help you understand your code later. (Many people write good code but then forget why they wrote it.) To write comments in Rust you usually use <code>//</code>:</p> <p>Comments are made for programmers to read, not the computer. It's good to write comments to help other people understand your code. It's also good to help you understand your code later. (Many people write good code but then forget why they wrote it.) To write comments in Rust you usually use <code>//</code>:</p>
<pre><pre class="playground"><code class="language-rust">fn main() { <pre><pre class="playground"><code class="language-rust">fn main() {
// Rust programs start with fn main() // Rust programs start with fn main()

@ -166,6 +166,7 @@
<h2><a class="header" href="#types" id="types">Types</a></h2> <h2><a class="header" href="#types" id="types">Types</a></h2>
<p>Rust has many types that let you work with numbers, characters, and so on. Some are simple, others are more complicated, and you can even create your own.</p> <p>Rust has many types that let you work with numbers, characters, and so on. Some are simple, others are more complicated, and you can even create your own.</p>
<h3><a class="header" href="#primitive-types" id="primitive-types">Primitive types</a></h3> <h3><a class="header" href="#primitive-types" id="primitive-types">Primitive types</a></h3>
<p><a href="https://youtu.be/OxTPU5UGMhs">See this chapter on YouTube</a></p>
<p>Rust has simple types that are called <strong>primitive types</strong> (primitive = very basic). We will start with integers and <code>char</code> (characters). Integers are whole numbers with no decimal point. There are two types of integers:</p> <p>Rust has simple types that are called <strong>primitive types</strong> (primitive = very basic). We will start with integers and <code>char</code> (characters). Integers are whole numbers with no decimal point. There are two types of integers:</p>
<ul> <ul>
<li>Signed integers,</li> <li>Signed integers,</li>

@ -167,6 +167,7 @@
<p><img src="https://github.com/Dhghomon/easy_rust/workflows/github%20pages/badge.svg" alt="example workflow name" /></p> <p><img src="https://github.com/Dhghomon/easy_rust/workflows/github%20pages/badge.svg" alt="example workflow name" /></p>
<p>22 December 2020: mdBook can be found <a href="https://dhghomon.github.io/easy_rust">here</a>.</p> <p>22 December 2020: mdBook can be found <a href="https://dhghomon.github.io/easy_rust">here</a>.</p>
<p>28 November 2020: <a href="https://github.com/kumakichi/easy_rust_chs">Now also available in simplified Chinese</a> thanks to <a href="https://github.com/kumakichi">kumakichi</a>!</p> <p>28 November 2020: <a href="https://github.com/kumakichi/easy_rust_chs">Now also available in simplified Chinese</a> thanks to <a href="https://github.com/kumakichi">kumakichi</a>!</p>
<p>1 February 2021: <a href="https://www.youtube.com/playlist?list=PLfllocyHVgsRwLkTAhG0E-2QxCf-ozBkk">Now available on YouTube!</a></p>
</main> </main>

@ -169,6 +169,7 @@
<p><img src="https://github.com/Dhghomon/easy_rust/workflows/github%20pages/badge.svg" alt="example workflow name" /></p> <p><img src="https://github.com/Dhghomon/easy_rust/workflows/github%20pages/badge.svg" alt="example workflow name" /></p>
<p>22 December 2020: mdBook can be found <a href="https://dhghomon.github.io/easy_rust">here</a>.</p> <p>22 December 2020: mdBook can be found <a href="https://dhghomon.github.io/easy_rust">here</a>.</p>
<p>28 November 2020: <a href="https://github.com/kumakichi/easy_rust_chs">Now also available in simplified Chinese</a> thanks to <a href="https://github.com/kumakichi">kumakichi</a>!</p> <p>28 November 2020: <a href="https://github.com/kumakichi/easy_rust_chs">Now also available in simplified Chinese</a> thanks to <a href="https://github.com/kumakichi">kumakichi</a>!</p>
<p>1 February 2021: <a href="https://www.youtube.com/playlist?list=PLfllocyHVgsRwLkTAhG0E-2QxCf-ozBkk">Now available on YouTube!</a></p>
<h2><a class="header" href="#introduction" id="introduction">Introduction</a></h2> <h2><a class="header" href="#introduction" id="introduction">Introduction</a></h2>
<p>Rust is a new language that already has good textbooks. But sometimes its textbooks are difficult because they are for native English speakers. Many companies and people now learn Rust, and they could learn faster with a book that has easy English. This textbook is for these companies and people to learn Rust with simple English.</p> <p>Rust is a new language that already has good textbooks. But sometimes its textbooks are difficult because they are for native English speakers. Many companies and people now learn Rust, and they could learn faster with a book that has easy English. This textbook is for these companies and people to learn Rust with simple English.</p>
<p>Rust is a language that is quite new, but already very popular. It's popular because it gives you the speed and control of C or C++ but also the memory safety of other newer languages like Python. It does this with some new ideas that are sometimes different from other languages. That means that there are some new things to learn, and you can't just &quot;figure it out as you go along&quot;. Rust is a language that you have to think about for a while to understand. But it still looks pretty familiar if you know another language and it is made to help you write good code.</p> <p>Rust is a language that is quite new, but already very popular. It's popular because it gives you the speed and control of C or C++ but also the memory safety of other newer languages like Python. It does this with some new ideas that are sometimes different from other languages. That means that there are some new things to learn, and you can't just &quot;figure it out as you go along&quot;. Rust is a language that you have to think about for a while to understand. But it still looks pretty familiar if you know another language and it is made to help you write good code.</p>
@ -363,6 +364,7 @@
<h1><a class="header" href="#part-1---rust-in-your-browser" id="part-1---rust-in-your-browser">Part 1 - Rust in your browser</a></h1> <h1><a class="header" href="#part-1---rust-in-your-browser" id="part-1---rust-in-your-browser">Part 1 - Rust in your browser</a></h1>
<p>This book has two parts. In Part 1, you will learn as much Rust as you can just in your browser. You can actually learn almost everything you need to know without installing Rust, so Part 1 is very long. Then at the end is Part 2. It is much shorter, and is about Rust on your computer. That's where you will learn everything else you need to know that you can only do outside of a browser. Some examples are: working with files, taking user input, graphics, and personal settings. Hopefully, by the end of Part 1 you will like Rust enough that you will install it. And if you don't, no problem - Part 1 teaches you so much that you won't mind.</p> <p>This book has two parts. In Part 1, you will learn as much Rust as you can just in your browser. You can actually learn almost everything you need to know without installing Rust, so Part 1 is very long. Then at the end is Part 2. It is much shorter, and is about Rust on your computer. That's where you will learn everything else you need to know that you can only do outside of a browser. Some examples are: working with files, taking user input, graphics, and personal settings. Hopefully, by the end of Part 1 you will like Rust enough that you will install it. And if you don't, no problem - Part 1 teaches you so much that you won't mind.</p>
<h2><a class="header" href="#rust-playground" id="rust-playground">Rust Playground</a></h2> <h2><a class="header" href="#rust-playground" id="rust-playground">Rust Playground</a></h2>
<p><a href="https://youtu.be/-lYeJeQ11OI">See this chapter on YouTube</a></p>
<p>Maybe you don't want to install Rust yet, and that's okay. You can go to <a href="https://play.rust-lang.org/">https://play.rust-lang.org/</a> and start writing Rust without leaving your browser. You can write your code there and click Run to see the results. You can run most of the samples in this book inside the Playground in your browser. Only near the end you will see samples that go beyond what you can do in the Playground (like opening files).</p> <p>Maybe you don't want to install Rust yet, and that's okay. You can go to <a href="https://play.rust-lang.org/">https://play.rust-lang.org/</a> and start writing Rust without leaving your browser. You can write your code there and click Run to see the results. You can run most of the samples in this book inside the Playground in your browser. Only near the end you will see samples that go beyond what you can do in the Playground (like opening files).</p>
<p>Here are some tips when using the Rust Playground:</p> <p>Here are some tips when using the Rust Playground:</p>
<ul> <ul>
@ -377,6 +379,7 @@
<h2><a class="header" href="#-and-" id="-and-">🚧 and ⚠️</a></h2> <h2><a class="header" href="#-and-" id="-and-">🚧 and ⚠️</a></h2>
<p>Sometimes the code examples in the book don't work. If an example doesn't work, it will have a 🚧 or a ⚠️ in it. 🚧 is like &quot;under construction&quot;: it means that the code is not complete. Rust needs a <code>fn main()</code> (a main function) to run, but sometimes we just want to look at small pieces of code so it won't have a <code>fn main()</code>. Those examples are correct, but need a <code>fn main()</code> for you to run them. And some code examples show you a problem that we will fix. Those ones might have a <code>fn main()</code> but generate an error, and so they will have a ⚠️.</p> <p>Sometimes the code examples in the book don't work. If an example doesn't work, it will have a 🚧 or a ⚠️ in it. 🚧 is like &quot;under construction&quot;: it means that the code is not complete. Rust needs a <code>fn main()</code> (a main function) to run, but sometimes we just want to look at small pieces of code so it won't have a <code>fn main()</code>. Those examples are correct, but need a <code>fn main()</code> for you to run them. And some code examples show you a problem that we will fix. Those ones might have a <code>fn main()</code> but generate an error, and so they will have a ⚠️.</p>
<h2><a class="header" href="#comments" id="comments">Comments</a></h2> <h2><a class="header" href="#comments" id="comments">Comments</a></h2>
<p><a href="https://youtu.be/fJ7jBZG_Rpo">See this chapter on YouTube</a></p>
<p>Comments are made for programmers to read, not the computer. It's good to write comments to help other people understand your code. It's also good to help you understand your code later. (Many people write good code but then forget why they wrote it.) To write comments in Rust you usually use <code>//</code>:</p> <p>Comments are made for programmers to read, not the computer. It's good to write comments to help other people understand your code. It's also good to help you understand your code later. (Many people write good code but then forget why they wrote it.) To write comments in Rust you usually use <code>//</code>:</p>
<pre><pre class="playground"><code class="language-rust">fn main() { <pre><pre class="playground"><code class="language-rust">fn main() {
// Rust programs start with fn main() // Rust programs start with fn main()
@ -407,6 +410,7 @@
<h2><a class="header" href="#types" id="types">Types</a></h2> <h2><a class="header" href="#types" id="types">Types</a></h2>
<p>Rust has many types that let you work with numbers, characters, and so on. Some are simple, others are more complicated, and you can even create your own.</p> <p>Rust has many types that let you work with numbers, characters, and so on. Some are simple, others are more complicated, and you can even create your own.</p>
<h3><a class="header" href="#primitive-types" id="primitive-types">Primitive types</a></h3> <h3><a class="header" href="#primitive-types" id="primitive-types">Primitive types</a></h3>
<p><a href="https://youtu.be/OxTPU5UGMhs">See this chapter on YouTube</a></p>
<p>Rust has simple types that are called <strong>primitive types</strong> (primitive = very basic). We will start with integers and <code>char</code> (characters). Integers are whole numbers with no decimal point. There are two types of integers:</p> <p>Rust has simple types that are called <strong>primitive types</strong> (primitive = very basic). We will start with integers and <code>char</code> (characters). Integers are whole numbers with no decimal point. There are two types of integers:</p>
<ul> <ul>
<li>Signed integers,</li> <li>Signed integers,</li>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save