Every one is fascinated with cryptocurrencies and profits, but it's very rare to find people learning with commitment about smart contracts, blockchain coding and so on.
I'm a cryptoenthusiast with passion and a will to learn how to code smart contracts, so when I found this amazing source and mini course I did not doubt it two times and I decided to post about it here, so everyone could take a look about how easy might be to be introduced in smart contracts programming.
Thus, let's start learning...
First We have to click on the link of the course in order to get redirected to the content.
https://cryptozombies.io/?ref=cryptominded
We will see a screen like this
We click on the purple button "Get started, It's free" and we will be redirected to an other page
We will see the game starting with the contextualization of a Zombie game
Then We will click on start and finally We will be on Lesson 1
A very useful thing about this course is the application of analogies, like compare a zombie factory to the database which is going to take care about all the zombies created.
Also each zombie will have a DNA type which is related to a 16-digit integer: 8356281049284737 and as it is un real life, each part of DNA will map an specific part of the zombie. (CryptoKittie Like hehe)
For example: For example, the first 2 digits of our example DNA above are 83. To map that to the zombie's head type, we do 83 % 7 + 1 = 7. So this Zombie would have the 7th zombie head type.
If We want to test this characteristics we can play with them using some buttons available before coding them.
On the next chapter We will be able to start with little bit of coding.
In a nutshell we start with the main important things while creating an smart contract.
On chapter 3 We are going to be introduced into how to declare a varible with an specific type. In this case since we seek to build a zombie with DNA of 16 bytes contract we must declare this data.
On chapter 4 we will start using math operations! Thus, these are the main ones:
Addition: x + y
Subtraction: x - y,
Multiplication: x * y
Division: x / y
Modulus / remainder: x % y (for example, 13 % 5 is 3, because if you divide 5 into 13, 3 is the remainder)
In order to create interaction we can create more complex data types like structures. At this point we will create one with attributes representing a zombie.
pragma solidity ^0.4.19;
contract ZombieFactory {
uint dnaDigits = 16;
uint dnaModulus = 10 ** dnaDigits;
// start here
struct Zombie{
string name;
uint dna;
}
}
Every time we got an answer right We can go throught to the next chapter.
So I will not spoiled you any more...I recommend this course A LOT if you want to learn smart contracts.
References