# \#ScryptoClassof2022 Week 2, Chapter 2 on Rust & Scrypto

**URL:** <https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405>\
**Category:** Scrypto\
**Tags:** howto\
**Created:** [19 June 2022 13:16 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405 "2022-06-19T13:16:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Austin](https://radixtalk.com/user_avatar/radixtalk.com/austin/32/735_2.png) [@Austin](https://radixtalk.com/u/Austin)\
**Post date:** [19 June 2022 13:16 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/1 "2022-06-19T13:16:47Z")

</div>

Week 1 is officially over and we have over 20 people starting their journey into Rust & Scrypto! I have seen many people take the first steps to set up their computer to code for the first time as well as others with a bit of experience dive into Rust for the first time! Congratulations everyone for taking the leap and getting started!

If you missed week 1, feel free to read through here and catch up!

> [@\#ScryptoClassof2022 Week 1, Chapter 1 Rust & Scrypto study group](https://radixtalk.com/t/scryptoclassof2022-week-1-chapter-1-materials-to-get-you-started-on-your-scrypto-journey/1207):
>
> Welcome everyone to Week 1, Chapter 1 of #ScryptoClassof2022. This all started as just a random post I made in the Radix telegram wondering if I could find a couple others who would join me in learning the basics of Rust in order to learn and start making really cool things with Scrypto. The response has been amazing! We will cover the first 8 chapters from “The Rust Programming Language” by Steve Klabnik and Carol Nichols. This should be sufficient rust knowledge to really be able to…

 ![image](https://radixtalk.com/uploads/default/original/1X/dc479616c16b9f5b61038c39b87a2389e0a1a420.png)

Several AWESOME projects have been nice enough to award prizes to the most active and helpful members of #ScryptoClassof2022!

[Radup.io](http://Radup.io) donating $XRD

[Ociswap.com](http://Ociswap.com) donating $OCI

[Delphibets.com](http://Delphibets.com) donating $DPH

Daxter donating [scryptochaps.com](http://scryptochaps.com) NFTs and Radix Pandas NFTs

[Cerberrads.com](http://Cerberrads.com) donating CerberRad NFTs

AIK\_ALLRADIX#2238 and [radixdltstaking.com](http://radixdltstaking.com) donating $XSE

I have also added 1 Scrypto Punk NFT to be awarded each week

All donations will be awarded to those active students that are contributing to the course and helping others solve problems each week!

Week 1 winners are @ArtiFICR#3622 , @Haseeb.xrd#0556, @Quwin#6226 , @NellySayon#0505, @erroll gnargnar#2915, @cryptocactus#8733, @Arc#7276, and @Mala#4140 on Discord! Please DM me your Radix wallet addresses and I will send prizes out soon.

If you didn’t get a prize this week, Fear not! We will have a ton more every single week with even more projects joining up to support our mission to be the future builders of #Scrypto and to show the world its power over Solidity.

Chapter 2 is a project chapter building the guessing\_game program. The book does an excellent job walking through the development of this program. I am going to include this program with brief descriptions of what each line does. Several people have completed this chapter early, but don’t get used to this slower pace! Chapter 3 and beyond picks up the pace covering a lot more material. While you are reading through Chapter 2, please post any questions you come across in the #Scrypto-Class-of-2022 discord group so we can all solve them together.

Let’s Get Rusty video covering chapter 2 content!

[![](https://radixtalk.com/uploads/default/original/2X/8/8732d3e73ceaee0cf5871989c747d8f23846dd19.jpeg "Programming a Guessing Game in Rust!") ](https://www.youtube.com/watch?v=H0xBSbnQYds)

 ![image](https://radixtalk.com/uploads/default/original/1X/ede72d3fe5b7e0c38c237083b393fbbfed88672f.jpeg)

Don’t forget to add your rand crate dependency in the .toml

 ![image](https://radixtalk.com/uploads/default/original/1X/cc5543125a266f158761780c6803941e89389cfa.png)

A command introduced in this chapter that I find very useful is:

‘cargo doc --open’

This will build documentation provided by all of your dependencies locally and open it in your browser. If you’re interested in other functionality in the `rand` crate, for example, run `cargo doc --open` and click `rand` in the sidebar on the left.

**Study Group Schedule**

~~June 12th - June 18th - Chapter 1~~

~~June 19th Time TBD - Live Q&A on chapter 1 content~~

June 19th - June 25th - Chapter 2

June 26th Time 12pm UTC - Live Q&A on chapter 1 - chapter 2 content

June 26th - July 2nd - Chapter 3

July 3rd Time 12pm UTC - Live Q&A on chapter 1 - chapter 3 content

July 3rd - July 9th - Chapter 4

July 10th Time 12pm UTC - Live Q&A on chapter 1 - chapter 4 content

July 10th - July 16th - Chapter 5

July 17th Time 12pm UTC - Live Q&A on chapter 1 - chapter 5 content

July 17th - July 23rd - Chapter 6

July 24th Time 12pm UTC - Live Q&A on chapter 1 - chapter 6 content

July 24th - July 30th - Chapter 7

July 31st Time 12pm UTC - Live Q&A on chapter 1 - chapter 7 content

July 31st - August 6th - Chapter 8

August 7th Time 12pm UTC - Live Q&A on chapter 1 - chapter 8 content

I’ll be editing these posts to make them more complete as we go, so if you think of anything important to add please comment below. We can begin discussing now with any questions that you may come across. No question is too stupid so please don’t be shy. Its not too late to start your journey with us into Scrypto, join us here:

[Radix - Radically Different DeFi](https://discord.gg/radixdlt) \<— discord server invite link

All you have to do is scroll down the chats on the left all the way to the developer section where you will see scrypto-class-of-2022

Thank you all for participating and keeping this an exciting experience while we all learn Rust and Scrypto together!

**Supplmental Info**

These tables for types of numbers are helpful for me since I have not memorized which is best to use just yet.

 ![image](https://radixtalk.com/uploads/default/original/1X/3c1e5dfb34400b56b406b9808d4f99c008afce42.png)

 ![image](https://radixtalk.com/uploads/default/original/1X/39a70bc9860a59a145187824440caa8fdb982e87.png)

Here is the free web version of the book we are using for this course.

> **[The Rust Programming Language - The Rust Programming Language](https://doc.rust-lang.org/book/)**

I am still trying to learn the ins and outs of using github, and this tutorial seems very complete.

Complete beginner’s guide to using Git

> **[What is version control | Atlassian Git Tutorial](https://www.atlassian.com/git/tutorials/what-is-version-control)**
>
> Version control is the practice of tracking and managing changes to software code. Learn about the benefits of version control systems here.

Github download

[https://desktop.github.com/](https://desktop.github.com/)

Git download

> **[Git - Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)**

**Git clone** pulls any repository in from url

**Git status** shows status

**Git add** add new files or changes to repository

**Git commit -m “”** locks into repository locally, with message

**Git push** pushes commits up to [github.com](http://github.com)

**Git pull** pulls down from [github.com](http://github.com)

_these only work within the directory of the github repository_

Learning rust by tons of small examples

> **[A half-hour to learn Rust](https://fasterthanli.me/articles/a-half-hour-to-learn-rust)**
>
> In order to increase fluency in a programming language, one has to read a lot of it.
> But how can you read a lot of it if you don’t know what it means?
> In this article, instead of focusing on one or...

Peter Kim’s Scrypto Journey!

> **[Peter Scrypto journey.pdf](https://drive.google.com/file/d/14Z4nsdlxClu-C2lLlaEDdYp29oeKnXQe/view)**
>
> Google Drive file.

**Awesome Videos**

[Rust Crash Course | Rustlang](https://www.youtube.com/watch?v=zF34dRivLOw&ab_channel=TraversyMedia) - Helpful crash course

[![](https://radixtalk.com/uploads/default/original/2X/1/1dacf599f7353e1f584b75e071c458ebf42914a0.jpeg "Rust Crash Course | Rustlang") ](https://www.youtube.com/watch?v=zF34dRivLOw)

**Getting started with Scrypto - This material has not been covered yet but provided in case you want to experiment**

> **[Florian Pieper in Radix Developer Discussion](https://t.me/RadixDevelopers/17184)**
>
> \#Scrypto
> 
> No you don't need previous Solidity knowledge, maybe even easier if you don't know the "wrong" concepts of Solidity.
> 
> However, it probably helps what you can do with smart contracts and what they are for. 
> 
> Join the developer group...

> **[Radix - Developer Hub](https://www.radixdlt.com/developers/home)**
>
> Radix's developer hub with everything you need to get started building DeFi with Scrypto.

[![](https://i.ytimg.com/vi/Mu8L-BJFfQM/hqdefault.jpg "Getting started with Scrypto!") ](https://www.youtube.com/watch?v=Mu8L-BJFfQM)

[Radix DeFi, Scrypto, and Smart Contract Learning Event - Live from Lisbon](https://youtu.be/b_pjocutISo)

---

<div class="post-metadata">

**Author:** ![NellySayon](https://radixtalk.com/user_avatar/radixtalk.com/nellysayon/32/536_2.png) [@NellySayon](https://radixtalk.com/u/NellySayon)\
**Post date:** [19 June 2022 14:17 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/2 "2022-06-19T14:17:11Z")

</div>

Thank you Austin for collecting and summarizing all this information.  
One small advice to everyone participating in the class: after successfully finishing the Guessing game, try to adjust it. E.g choose other numbers, change the name of the variables, change the messages or even try to introduce an option for the player to quit the game. This will help you to understand what the code is actually doing.

---

<div class="post-metadata">

**Author:** ![Ratty](https://radixtalk.com/user_avatar/radixtalk.com/ratty/32/895_2.png) [@Ratty](https://radixtalk.com/u/Ratty)\
**Post date:** [19 June 2022 14:37 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/3 "2022-06-19T14:37:17Z")

</div>

Thanks for posting this, I am not a programmer but I certainty want to look into this and try it out, will let you know how I get on!

---

<div class="post-metadata">

**Author:** ![AV7744](https://radixtalk.com/user_avatar/radixtalk.com/av7744/32/572_2.png) [@AV7744](https://radixtalk.com/u/AV7744)\
**Post date:** [19 June 2022 15:25 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/4 "2022-06-19T15:25:03Z")

</div>

Thanks for creating this. I have also started my Rust/Scrypto journey recently and will try to be more active in the discord.

---

<div class="post-metadata">

**Author:** ![erroll\_gnargnar](https://radixtalk.com/user_avatar/radixtalk.com/erroll_gnargnar/32/886_2.png) [@erroll\_gnargnar](https://radixtalk.com/u/erroll_gnargnar)\
**Post date:** [19 June 2022 15:27 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/5 "2022-06-19T15:27:01Z")

</div>

Thanks for writing this all out!

---

<div class="post-metadata">

**Author:** ![TamasH](https://radixtalk.com/user_avatar/radixtalk.com/tamash/32/563_2.png) [@TamasH](https://radixtalk.com/u/TamasH)\
**Post date:** [19 June 2022 17:35 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/6 "2022-06-19T17:35:36Z")

</div>

I am also planning to finally join, maybe I am not too late. 😉 And hope to be easier with a little background of IT. Keep this weekly posts coming, because this will be my starting point.

---

<div class="post-metadata">

**Author:** ![Austin](https://radixtalk.com/user_avatar/radixtalk.com/austin/32/735_2.png) [@Austin](https://radixtalk.com/u/Austin)\
**Post date:** [19 June 2022 18:51 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/7 "2022-06-19T18:51:58Z")

</div>

You are definitely not too late. Chapter 1 and 2 are pretty quick to read and learn. Chapter 1 is mostly just getting your computer set up. Chapter 2 is developing a simple program that is a number guessing game and Chapter 2 reading just started today. you could literally be caught up to pace in a couple days. Chapter 3 and forward is where the content gets a little more complicated, but at this point it shouldnt be bad at all to do the first two chapters this week! Feel free to ask here, telegram @aus87 or discord in the Scrypto-class-of-2022 channel for any help you need.

---

<div class="post-metadata">

**Author:** ![cbisaillon](https://radixtalk.com/user_avatar/radixtalk.com/cbisaillon/32/55_2.png) [@cbisaillon](https://radixtalk.com/u/cbisaillon)\
**Post date:** [20 June 2022 16:32 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/8 "2022-06-20T16:32:19Z")

</div>

Thanks again Austin for managing this class.  
This is the best place for people to get started in Rust/Scrypto

---

<div class="post-metadata">

**Author:** ![Radiated](https://radixtalk.com/user_avatar/radixtalk.com/radiated/32/777_2.png) [@Radiated](https://radixtalk.com/u/Radiated)\
**Post date:** [21 June 2022 01:15 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/9 "2022-06-21T01:15:46Z")

</div>

Man, my code says I have 17 syntax errors. 😂 Rustc and rust analyzer are hard on me.

---

<div class="post-metadata">

**Author:** ![TamasH](https://radixtalk.com/user_avatar/radixtalk.com/tamash/32/563_2.png) [@TamasH](https://radixtalk.com/u/TamasH)\
**Post date:** [21 June 2022 05:23 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/10 "2022-06-21T05:23:07Z")

</div>

Luckily the analyzer / linter is clever enough that after you save your file, you will see all your errors with a self-explanatory message. But I do agree with you, you need a little time to just get used to the syntax. 🙂

---

<div class="post-metadata">

**Author:** ![Austin](https://radixtalk.com/user_avatar/radixtalk.com/austin/32/735_2.png) [@Austin](https://radixtalk.com/u/Austin)\
**Post date:** [21 June 2022 10:08 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/11 "2022-06-21T10:08:05Z")

</div>

You aren’t the only one! As you figure out what is going wrong you will learn a lot. I had the same and found a few spaces in the wrong places among other things.

---

<div class="post-metadata">

**Author:** ![DELPHIBETS](https://radixtalk.com/user_avatar/radixtalk.com/delphibets/32/332_2.png) [@DELPHIBETS](https://radixtalk.com/u/DELPHIBETS)\
**Post date:** [21 June 2022 19:40 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/12 "2022-06-21T19:40:15Z")

</div>

Amazingly good article! Keep up the good work 🔥

---

<div class="post-metadata">

**Author:** ![kevinbreaker](https://radixtalk.com/user_avatar/radixtalk.com/kevinbreaker/32/1004_2.png) [@kevinbreaker](https://radixtalk.com/u/kevinbreaker)\
**Post date:** [3 July 2022 02:10 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/13 "2022-07-03T02:10:02Z")

</div>

Great!! Thanks for creating this. I want to develop something for Radix in the future.

---

<div class="post-metadata">

**Author:** ![Austin](https://radixtalk.com/user_avatar/radixtalk.com/austin/32/735_2.png) [@Austin](https://radixtalk.com/u/Austin)\
**Post date:** [3 July 2022 14:29 UTC](https://radixtalk.com/t/scryptoclassof2022-week-2-chapter-2-on-rust-scrypto/1405/14 "2022-07-03T14:29:52Z")

</div>

I had no idea what coding even entailed a few weeks ago. Now I have written several Rust programs to calculate a given number in the fibonacci sequence and converting temperatures between Celsius and Fahrenheit. Its been an awesome and rewarding experience learning this stuff already. If I can do this, certainly anyone can.
