This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod stack_heap_example; | |
use crate::stack_heap_example::stack_and_heap; | |
#[allow(dead_code)] | |
#[allow(unused_variables)] | |
fn main() { | |
stack_and_heap(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(dead_code)] | |
#[allow(unused_variables)] | |
fn main() { | |
scope_and_shadowing(); | |
constnts(); | |
} | |
fn scope_and_shadowing() { | |
let age = 23; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(dead_code)] | |
#[allow(unused_variables)] | |
fn main() { | |
operators(); | |
bitwise_operators(); | |
logical_operators(); | |
} | |
fn operators() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(dead_code)] | |
#[allow(unused_variables)] | |
const AVERAGE_AGE : u8 = 60; // no fixed address | |
static PREFIX : char = 'A'; // fixed address | |
static mut AGE : u8 = 22; // mutable fixed address | |
fn main() { | |
data_types(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0 <0.6.0; | |
contract ZombieFactory { | |
event NewZombie(uint zombieId, string name, uint dna); | |
uint dnaDigits = 16; | |
uint dnaModulus = 10 ** dnaDigits; | |
struct Zombie { |