Commit 282c1b2

mo khan <mo@mokhan.ca>
2023-02-13 20:59:04
start to build the guessing game
1 parent 55d9353
Changed files (4)
2.0/guessing_game/src/main.rs
@@ -0,0 +1,11 @@
+use std::io;
+
+fn main() {
+    println!("Guess the number!");
+    println!("Please input your guess.");
+    let mut guess = String::new();
+
+    io::stdin().read_line(&mut guess).expect("Failed to read line");
+
+    println!("You guessed: {guess}");
+}
2.0/guessing_game/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
2.0/guessing_game/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
README.md
@@ -2,7 +2,7 @@
 
 current: https://doc.rust-lang.org/book/ch01-01-installation.html
 
-# Shell
+## Shell
 
 Compile a single file.
 
@@ -33,3 +33,9 @@ Check for errors in a cargo project:
 ```bash
 $ cargo check
 ```
+
+## Standard Library
+
+* [Docs][1]
+
+[1]: https://doc.rust-lang.org/std/prelude/index.html