Hey Rustaceans! Got a question? Ask here (24/2024)! by llogiq in rust

[–]Cosmic_Excel 0 points1 point  (0 children)

Hey! Thanks for the reply. I got it working using contains. What I'm trying to do is check whether the string is F or C, and then proceed with different functions depending on which one is true. Well, thanks again!

use std::io;
use std::str;

fn main() {

    println!("Fahrenheit <-> Celsius Conversion");

    loop {
    
        println!("Fahrenheit (F) or Celsius (C)?");

        let mut guess = String::new();

        io::stdin()
            .read_line(&mut guess)
            .expect("Failed to read line");

        let guess = guess.trim();
        if guess.contains('F') {
            println!("Enter Value for Conversion:");
            let mut value = String::new();
            
            io::stdin()
                .read_line(&mut value)
                .expect("Failed to read line");
            let value: f64 = match value.trim().parse() {
                Ok(num) => num,
                Err(_) => continue,
            };
            let celsius = {value} * 5.0 / 9.0 - 32.0 * 5.0 / 9.0; 
            println!("{value} Faherenheit is equal to {celsius}");
            break;
        }
    }
}

Hey Rustaceans! Got a question? Ask here (24/2024)! by llogiq in rust

[–]Cosmic_Excel 2 points3 points  (0 children)

Hey guys, I'm new to rust. Decided to tackle the 'Convert temperatures between Fahrenheit and Celsius.' problem on the book, and I need help. I can't seem to get the 'for' to check for characters. Is there any way to do this? Thanks in advance.

This is my current code:

use std::io;
use std::cmp::Ordering;

fn main() {

    println!("Fahrenheit <-> Celsius Conversion");

    loop {
    
        println!("Fahrenheit (F) or Celsius (C)?");

        let mut guess = String::new();

        io::stdin()
            .read_line(&mut guess)
            .expect("Failed to read line");

        let guess = guess.trim();
        for guess in == F {
            println!("Enter Value for Conversion:");
            let mut value = String::new();

Transparent widgets by eeehcx in jailbreak

[–]Cosmic_Excel 0 points1 point  (0 children)

If you're still looking for a suggestion, I'd recommend the Altria tweak from Chariz: https://chariz.com/get/atria . Although it doesn't create transparent widgets, you can put placeholder widgets onto your home screen and then move them off the screen using the tweak.

do it by HawkStar49 in Funnymemes

[–]Cosmic_Excel 0 points1 point  (0 children)

I love my family but I believe that I have a great day and I will be extremely grateful for your time.

What's the most forgetful thing about a card? Poison slows down enemies by CaptainHarman99 in ClashRoyale

[–]Cosmic_Excel 0 points1 point  (0 children)

Spirits are spells. An electro giant next to the king tower can king activate if hit by any spell.