From 72ce766c501533f8f41a6b16507e23d893ff8e3d Mon Sep 17 00:00:00 2001 From: zombie Date: Sat, 27 Nov 2021 16:08:19 -0500 Subject: [PATCH] added the things --- .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 8 ++++++++ src/main.rs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..2654e46 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "rust_dumping-ground" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..fbf8617 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "rust_dumping-ground" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..3bec46c --- /dev/null +++ b/src/main.rs @@ -0,0 +1,49 @@ +use std::io; + +fn main() { + //thomas gay + println!("Hello, world!"); //println! is a macro + let mut x = 69; + println!("asdasdasd{0}{0}", x); + fn thomasfunc() { + //thomas gay + println!("father of lies") + } + thomasfunc(); + x = x + 1; + println!("{}", x); + + while x != 1 { + + println!("number = {0}", x); + + if (x % 2) == 0 { + + println!("even{0}", x); + x = x / 2; + } else { + x = (3 * x) + 1; + } + + } + + + let mut thebestx:f32 = 0.0; + let mut thebestx2:f32 = 0.0; + let a:f32 = 1.0; + let b:f32 = 2.0; + let c:f32 = -3.0; + + + + thebestx = (-b + (b.powf(2.0f32) - 4.0f32 * a * c).sqrt())/(2.0f32 * a); + thebestx2 = (-b - (b.powf(2.0f32) - 4.0f32 * a * c).sqrt())/(2.0f32 * a); + println!("x+={0} x-={1} a={2} b={3} c={4}", thebestx, thebestx2, a, b ,c) + + + + + + + +}