idk what im doing lol

This commit is contained in:
Emily 2020-07-08 15:13:09 +10:00
parent 251fb1aa20
commit 1bfaf3b07a
88 changed files with 0 additions and 254 deletions

View file

@ -1,11 +0,0 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

View file

@ -1,84 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "getrandom"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
dependencies = [
"cfg-if",
"libc",
"wasi",
]
[[package]]
name = "guessing_game"
version = "0.1.0"
dependencies = [
"rand",
]
[[package]]
name = "libc"
version = "0.2.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701"
[[package]]
name = "ppv-lite86"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea"
[[package]]
name = "rand"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
dependencies = [
"getrandom",
"libc",
"rand_chacha",
"rand_core",
"rand_hc",
]
[[package]]
name = "rand_chacha"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
dependencies = [
"ppv-lite86",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
dependencies = [
"getrandom",
]
[[package]]
name = "rand_hc"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [
"rand_core",
]
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"

View file

@ -1,10 +0,0 @@
[package]
name = "guessing_game"
version = "0.1.0"
authors = ["Emily J. <me@emily.im>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = "0.7.3"

View file

@ -1,52 +0,0 @@
/*
* Simple number guessing game I made using the tutorial at
* https://doc.rust-lang.org/stable/book/ch02-00-guessing-game-tutorial.html
*/
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
// Generates random number between 0 and 100, thread_rng is the generator we're using
let number = rand::thread_rng().gen_range(0, 101);
let mut tries = 1;
println!("Choose a number between 0 and 100: ");
loop {
// Defines a mutable variable that returns a string, don't know why constants exist yet
let mut guess = String::new();
// the & symbol in front of mut means its a reference, whatever that means lol
io::stdin()
.read_line(&mut guess)
.expect("Failed to read line.");
// Remove whitespace and convert the input into an unsigned 32 bit integer, using match statement to handle err
let guess: u32 = match guess.trim().parse() {
Ok(num) => num,
Err(_) => {
println!("Invalid input, please type a number!");
continue;
}
};
// Checks whether the guess is higher, lower or equal to the random number
// I added a tries thing myself, that tells you how many turns it took for you to guess the number
match guess.cmp(&number) {
Ordering::Less => {
println!("Higher!");
tries += 1;
}
Ordering::Greater => {
println!("Lower!");
tries += 1;
}
Ordering::Equal => {
println!("You win! You took {} tries to guess the number.", tries);
break;
}
}
}
}

View file

@ -1 +0,0 @@
{"rustc_fingerprint":7448185015360785229,"outputs":{"1164083562126845933":["rustc 1.44.1 (c7087fe00 2020-06-17)\nbinary: rustc\ncommit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7\ncommit-date: 2020-06-17\nhost: x86_64-unknown-linux-gnu\nrelease: 1.44.1\nLLVM version: 9.0\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/emily/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""]},"successes":{}}

View file

@ -1 +0,0 @@
{"rustc_fingerprint":7448185015360785229,"outputs":{"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/emily/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""],"1164083562126845933":["rustc 1.44.1 (c7087fe00 2020-06-17)\nbinary: rustc\ncommit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7\ncommit-date: 2020-06-17\nhost: x86_64-unknown-linux-gnu\nrelease: 1.44.1\nLLVM version: 9.0\n",""]},"successes":{}}

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":1796177550603792182,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/guessing_game-26c3e7d98df99986/dep-bin-guessing_game-26c3e7d98df99986"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":1796177550603792182,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/guessing_game-a7f4c8c042c37a73/dep-test-bin-guessing_game-a7f4c8c042c37a73"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/guessing_game/target/rls/debug/deps/guessing_game-26c3e7d98df99986.rmeta: src/main.rs
/home/emily/Documents/Projects/rust-practice/guessing_game/target/rls/debug/deps/guessing_game-26c3e7d98df99986.d: src/main.rs
src/main.rs:

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/guessing_game/target/rls/debug/deps/guessing_game-a7f4c8c042c37a73.rmeta: src/main.rs
/home/emily/Documents/Projects/rust-practice/guessing_game/target/rls/debug/deps/guessing_game-a7f4c8c042c37a73.d: src/main.rs
src/main.rs:

BIN
hello

Binary file not shown.

View file

@ -1,6 +0,0 @@
// i want to hug ferris
fn main() {
println!("Hello World!");
println!("I'm a Rustacean!");
}

View file

@ -1,10 +0,0 @@
# will have compiled files and executables
debug/
target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

View file

@ -1,5 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "hello_cargo"
version = "0.1.0"

View file

@ -1,9 +0,0 @@
[package]
name = "hello_cargo"
version = "0.1.0"
authors = ["Emily J. <me@emily.im>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View file

@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}

View file

@ -1 +0,0 @@
{"rustc_fingerprint":7448185015360785229,"outputs":{"1164083562126845933":["rustc 1.44.1 (c7087fe00 2020-06-17)\nbinary: rustc\ncommit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7\ncommit-date: 2020-06-17\nhost: x86_64-unknown-linux-gnu\nrelease: 1.44.1\nLLVM version: 9.0\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/emily/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""]},"successes":{}}

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":5720932018286141759,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/hello_cargo-1ad55237b5249d1f/dep-bin-hello_cargo-1ad55237b5249d1f"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":5720932018286141759,"profile":14996655781355331481,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/hello_cargo-405c571815312809/dep-bin-hello_cargo-405c571815312809"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/debug/deps/hello_cargo-1ad55237b5249d1f.rmeta: src/main.rs
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/debug/deps/hello_cargo-1ad55237b5249d1f.d: src/main.rs
src/main.rs:

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/debug/deps/hello_cargo-405c571815312809: src/main.rs
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/debug/deps/hello_cargo-405c571815312809.d: src/main.rs
src/main.rs:

Binary file not shown.

View file

@ -1 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/debug/hello_cargo: /home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":5720932018286141759,"profile":2574335274271406459,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release/.fingerprint/hello_cargo-f0cba58515a29096/dep-bin-hello_cargo-f0cba58515a29096"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/release/deps/hello_cargo-f0cba58515a29096: src/main.rs
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/release/deps/hello_cargo-f0cba58515a29096.d: src/main.rs
src/main.rs:

View file

@ -1 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/release/hello_cargo: /home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs

View file

@ -1 +0,0 @@
{"rustc_fingerprint":7448185015360785229,"outputs":{"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/emily/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""],"1164083562126845933":["rustc 1.44.1 (c7087fe00 2020-06-17)\nbinary: rustc\ncommit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7\ncommit-date: 2020-06-17\nhost: x86_64-unknown-linux-gnu\nrelease: 1.44.1\nLLVM version: 9.0\n",""]},"successes":{}}

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":5720932018286141759,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/hello_cargo-1ad55237b5249d1f/dep-bin-hello_cargo-1ad55237b5249d1f"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1 +0,0 @@
This file has an mtime of when this was started.

View file

@ -1 +0,0 @@
{"rustc":11295616921483704964,"features":"[]","target":5720932018286141759,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/hello_cargo-b4da91f62f80fb2e/dep-test-bin-hello_cargo-b4da91f62f80fb2e"}}],"rustflags":[],"metadata":6881552442942698694}

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/rls/debug/deps/hello_cargo-1ad55237b5249d1f.rmeta: src/main.rs
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/rls/debug/deps/hello_cargo-1ad55237b5249d1f.d: src/main.rs
src/main.rs:

View file

@ -1,5 +0,0 @@
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/rls/debug/deps/hello_cargo-b4da91f62f80fb2e.rmeta: src/main.rs
/home/emily/Documents/Projects/rust-practice/hello_cargo/target/rls/debug/deps/hello_cargo-b4da91f62f80fb2e.d: src/main.rs
src/main.rs:

View file

@ -1 +0,0 @@
{"config":{"output_file":null,"full_docs":false,"pub_only":false,"reachable_only":false,"distro_crate":false,"signatures":false,"borrow_data":false},"version":"0.19.0","compilation":{"directory":"/home/emily/Documents/Projects/rust-practice/hello_cargo","program":"/home/emily/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rls","arguments":[],"output":"/home/emily/Documents/Projects/rust-practice/hello_cargo/target/rls/debug/deps/libhello_cargo-1ad55237b5249d1f.rmeta"},"prelude":{"crate_id":{"name":"hello_cargo","disambiguator":[11820019386030937771,3583950356114279377]},"crate_root":"src","external_crates":[{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":1,"id":{"name":"std","disambiguator":[12673765241971086519,1979875191208036248]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":2,"id":{"name":"core","disambiguator":[16221439354469382097,15565837348772828253]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":3,"id":{"name":"compiler_builtins","disambiguator":[15613252303691562375,4556165055238676072]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":4,"id":{"name":"rustc_std_workspace_core","disambiguator":[12269617896898487533,65142111397584226]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":5,"id":{"name":"alloc","disambiguator":[15862783141653200230,4773813417861420487]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":6,"id":{"name":"libc","disambiguator":[501305773035659233,3889300012469539238]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":7,"id":{"name":"unwind","disambiguator":[9126002216567348836,15610270334556716503]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":8,"id":{"name":"cfg_if","disambiguator":[9479301707518706798,13352731276321566042]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":9,"id":{"name":"backtrace","disambiguator":[15203654865662241151,17897348793673631766]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":10,"id":{"name":"rustc_demangle","disambiguator":[10290502124864695413,7672610073830174493]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":11,"id":{"name":"backtrace_sys","disambiguator":[14838544226648722576,13006716085524361330]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":12,"id":{"name":"hashbrown","disambiguator":[9246889555580827340,16878203682218964580]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":13,"id":{"name":"rustc_std_workspace_alloc","disambiguator":[8284748314555817558,4769950866534510046]}},{"file_name":"/home/emily/Documents/Projects/rust-practice/hello_cargo/src/main.rs","num":14,"id":{"name":"panic_unwind","disambiguator":[14671874173783541769,17969261176539820175]}}],"span":{"file_name":"src/main.rs","byte_start":0,"byte_end":44,"line_start":1,"line_end":3,"column_start":1,"column_end":2}},"imports":[],"defs":[{"kind":"Mod","id":{"krate":0,"index":0},"span":{"file_name":"src/main.rs","byte_start":0,"byte_end":44,"line_start":1,"line_end":3,"column_start":1,"column_end":2},"name":"","qualname":"::","value":"src/main.rs","parent":null,"children":[{"krate":0,"index":1},{"krate":0,"index":2},{"krate":0,"index":3}],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Function","id":{"krate":0,"index":3},"span":{"file_name":"src/main.rs","byte_start":3,"byte_end":7,"line_start":1,"line_end":1,"column_start":4,"column_end":8},"name":"main","qualname":"::main","value":"fn () -> ()","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]}],"impls":[],"refs":[],"macro_refs":[],"relations":[]}

File diff suppressed because one or more lines are too long