-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve function with other functions and comments
- Loading branch information
1 parent
bff37ee
commit 789ff7c
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
// Main function | ||
fn main() { | ||
println!("Hello, Satoshi!"); | ||
|
||
println!("-----Wallet-----"); | ||
|
||
another_function(99999); | ||
|
||
print_labeled_measurement(21000, 's') | ||
print_labeled_measurement(21000, 's'); | ||
|
||
let x = { | ||
let y = 6; | ||
y + 1 | ||
}; | ||
println!("Value of x is: {x}."); | ||
let x = five(); | ||
println!("Value of x is now: {x}.") | ||
} | ||
|
||
// Simple function that print provided Bitcoin Price | ||
fn another_function(x: i32) { | ||
println!("The Bitcoin price is {x}"); | ||
} | ||
|
||
// Function that prints value and unit | ||
fn print_labeled_measurement(value: i32, unit_label: char) { | ||
println!("Bitcoin Balance : {value}{unit_label}"); | ||
} | ||
|
||
// Function that returns 5 | ||
fn five() -> i32 { | ||
5 | ||
} |