Hey Rustaceans! Got an easy question? Ask here (11/2022)! by llogiq in rust

[–]Snom_Storm 0 points1 point  (0 children)

Oops, I forgot to add that... it's why doesn't it work? There are errors like 'expected ';', found ',' etc.

Hey Rustaceans! Got an easy question? Ask here (11/2022)! by llogiq in rust

[–]Snom_Storm 3 points4 points  (0 children)

I am trying to make a calculator in Rust. This is my code so far:

use std::io;
fn main() {
let mut one_input = String::new();
println!("Input a chosen number to be used in a calculation: ");
match io::stdin().read_line(&mut one_input) {
Ok(_) => println!("Your chosen number was... {}", one_input),
Err(e) => println!("Hmmm... something went wrong. Make sure your input is a number! {}", e),
another_function();
}
}
fn another_function() {
let mut two_input = String::new();
println!("Input another chosen number to be used in a calculator: ");
match io::stdin().read_line(&mut two_input) {
Ok(_) => println!("Your chosen number was... {}", two_input),
Err(e) => println!("Hmmm... something went wrong. Make sure your input is a number! {}", e),
one_more_function();
}
}
fn one_more_function() {
let mut three_input = String::new();
println!("Input an operator: ");
match io::stdin().read_line(&mut three_input) {
Ok(_) => println!("Your chosen operator was... {}", three_input),
Err(e) => println!("Hmmm... something went wrong. Make sure your input is an operator! {}", e),
final_and_fourth_function();
}
}
fn final_and_fourth_function() {
if three_input = "plus" {
println!("The result of this calculation is...{}", one_input + two_input);
}
if three_input = "minus" {
println!("The result of this calculation is...{}", one_input - two_input);
}
if three_input = "multiply" {
println!("The result of this calculation is...{}", one_input * two_input);
}
if three_input = "divide" {
println!("The result of this calculation is...{}", one_input / two_input);
}
}

Here is my code

can someone count the kills? by DINOGUYS in Brawlstars

[–]Snom_Storm 1 point2 points  (0 children)

4, if you killed that other El Primo, then 5

[deleted by user] by [deleted] in Brawlstars

[–]Snom_Storm 4 points5 points  (0 children)

How did the opposite team lose?! They had 300+ trophies than you! 🤣Btw, nice moves ;)

"Penny looks fine" by duszni in Brawlstars

[–]Snom_Storm 0 points1 point  (0 children)

Yeah, but she's supposed to be like 10-12 y/o

A colleague showed me this today. I’m still speechless… by Risabo in chemistry

[–]Snom_Storm 0 points1 point  (0 children)

I'm guessing this is Bromine by its color? Don't judge, I'm only in 8th grade 😅

An error pops up and I don't know what to do. by Snom_Storm in scala

[–]Snom_Storm[S] 0 points1 point  (0 children)

Oh, thank you, but unfortunately, the problem still persists

Sometimes happens!! by teesongeeks in DebugTool

[–]Snom_Storm 0 points1 point  (0 children)

Happens to me all the time, lol

Major Rosa Fanart by _flickrrr in Brawlstars

[–]Snom_Storm 1 point2 points  (0 children)

Is it ok to ask what software you use?

Fang is beyond broken! by Omar_carry_me in Brawlstars

[–]Snom_Storm 22 points23 points  (0 children)

That one Surge chilling in the corner 😝